Skip to content

Designer Props

Component props parameter configuration guide and complete parameter descriptions.

Mobile designer is the fc-designer-mobile component

Vue3

vue
<template>
    <fc-designer ref="designer" :height="height" :config="config"/>
</template>
<script setup>
    const designer = ref(null);
    const height = ref('100vh');
    const config = ref({
        showSaveBtn: true
    });
</script>
Vue2
vue
<template>
    <fc-designer ref="designer" :height="height" :config="config"></fc-designer>
</template>
<script>
    export default {
        name: 'Component',
        data() {
            return {
                height: '100vh',
                config: {
                    showSaveBtn: true
                },
            };
        },
    };
</script>

Configuration Items

Complete configuration items and descriptions:

Property NameDescriptionType
localeMulti-language configuration object. Default is Chinese. By setting this property, you can switch to interface text in other languages.Object
maskWhether to show component mask layer. Default is true, at which time users cannot operate components. Setting to false allows users to directly operate components in the designer.boolean
heightDesigner component height. Can use strings (e.g., 500px, 100vh) or numbers (e.g., 500). Specifies the display height of the designer.string|number
menuCustom left menu list. This configuration will override the designer's default menu list. MenuList should contain the menu items you want to display on the left side of the designer.MenuList
configConfigure module display state and default rules within the designer. Through this configuration, you can control which modules are visible. See Complete Configuration.Config
handleExtended operation buttons at the top of the designer. Handle is an array containing button names and callback functions. Through this configuration, you can add custom operation buttons and specify their behavior.Handle

config Configuration Items

Configuration ItemTypeDescription
fontFamilyArray<string | {label: string, value: string}>Extended fonts
device'100%' | stringConfigure design area display method
switchTypefalse | Array<string[]>Whether component types can be switched, or fields that can be switched to each other
autoActivebooleanWhether to automatically select dragged components
localeOptionsArray<{value: string, label: string}>Multi-language types
beforeRemoveRule(data: { rule: Rule }) => false|voidPre-delete component event, return false to cancel deletion
beforeActiveRule(data: { rule: Rule }) => false|voidPre-select component event, return false to cancel selection
configFormOrderArray<'base' | 'advanced' | 'props' | 'slots' | 'style' | 'event' | 'validate'>Order of component configuration items
checkDrag(drag: {rule: Rule | undefined, menu: DragRule, toRule: Rule, toMenu: DragRule}) => booleanDetermine if component can be dragged in
hotKeybooleanWhether to enable keyboard shortcuts, enabled by default
autoResetNamebooleanWhether to automatically reset component name when copying, enabled by default
autoResetFieldbooleanWhether to automatically reset component field when copying, enabled by default
updateConfigOnBlurbooleanRight-side configuration update method
useTemplatebooleanWhether to generate Vue2 syntax template components
formOptionsObjectDefine form configuration default values
fieldReadonlybooleanConfigure whether field can be edited
nameReadonlybooleanConfigure whether name can be edited
validateOnlyRequiredbooleanControl whether component validation only shows required validation
hiddenDragMenubooleanHide drag operation buttons
hiddenDragBtnbooleanHide drag buttons
componentPermissionComponentPermission[]Control component configuration permissions
hiddenMenuMenuName[]Hide some menus
hiddenItemstring[]Hide some components
hiddenFormConfigstring[]Hide some form configuration items
disabledFormConfigstring[]Disable some form configuration items
hiddenItemConfigObjectHide some component configuration items
disabledItemConfigObjectDisable some component configuration items
allowDragObjectList of components that can be dragged in
denyDragObjectList of components that cannot be dragged in
showMenuBarbooleanWhether to show left side
showSaveBtnbooleanWhether to show save button
showPreviewBtnbooleanWhether to show preview button
showConfigbooleanWhether to show right-side configuration interface
showBaseFormbooleanWhether to show component's basic configuration form
showComponentNamebooleanWhether to show component number
showControlbooleanWhether to show component linkage
showJsonPreviewbooleanWhether to show JSON preview button
showCustomPropsbooleanWhether to show custom props button
showPropsFormbooleanWhether to show component's property configuration form
showStyleFormbooleanWhether to show component's style configuration form
showEventFormbooleanWhether to show component's event configuration form
showValidateFormbooleanWhether to show component's validation configuration form
showFormConfigbooleanWhether to show form configuration
showDevicebooleanWhether to show multi-device adaptation options
showInputDatabooleanWhether to show input button
showLanguagebooleanWhether to show internationalization configuration
exitConfirmbooleanConfirmation dialog when closing page
appendConfigDatastring[] | ((rule: Rule) => Object)Define formData required for rendering rules
baseRuleextendRuleRendering rules for basic configuration, can override default rules
validateRuleextendRuleRendering rules for validation configuration, can override default rules
formRuleextendRuleRendering rules for form, can override default rules
componentRuleObjectRendering rules for component configuration, can override default rules
updateDefaultRuleObjectSet component initialization rules

For complete type definitions of configuration items, please refer to the TypeScript data structure documentation: TypeScript Data Structure

Examples

Define Designer Height

Define the form designer component height by setting the height property to '100vh'

vue
<template>
    <fc-designer ref="designer" :height="height"></fc-designer>
</template>
<script>
    export default {
        name: 'Component',
        data() {
            return {
                height: '100vh',
            };
        },
    };
</script>

Hide Sub-form Menu

Hide the "Sub-form" menu option in the form designer interface through the hiddenMenu property of the configuration

vue
<template>
    <fc-designer ref="designer" :config="config"></fc-designer>
</template>
<script>
    export default {
        name: 'Component',
        data() {
            return {
                config: {
                    hiddenMenu: ['subform']
                },
            };
        },
    };
</script>

Hide Specified Components

Hide specific components in the form designer such as sub-forms, groups, tree controls, and tree selectors through the hiddenItem property of the configuration

vue
<template>
    <fc-designer ref="designer" :config="config"></fc-designer>
</template>
<script>
    export default {
        name: 'Component',
        data() {
            return {
                config: {
                    hiddenItem: ['subForm', 'group', 'tree', 'elTreeSelect']
                },
            };
        },
    };
</script>

Show Save Button

Enable the save button at the top of the form designer by setting showSaveBtn: true, and define a save method to handle the save event

vue
<template>
    <fc-designer ref="designer" :config="config" @save="save"></fc-designer>
</template>
<script>
    export default {
        name: 'Component',
        data() {
            return {
                config: {
                    showSaveBtn: true
                },
            };
        },
        methods: {
            save() {
                // todo
            }
        }
    };
</script>