# Global config

# Setting global configuration

  • Component mode
<form-create :option="option"></form-create>
  • Global method
vm.$formCreate(rule,option)
window.formCreate.create(rule,option)

# Structure

In global configuration, the following additional configuration items are supported

  • form:Form overall display rule configuration
  • row:Form component layout configuration
  • submitBtn:Submit button style configuration
  • resetBtn:Reset button style configuration
  • info:Component prompt message configuration
  • wrap: configuration FormItem v2.5.0+

# option.form

  • TypeObject

  • Description:Form overall display rule configuration

  • Defaults:

    {
        hideRequiredMark: false,
        layout: 'horizontal',
        labelAlign: 'right',
        labelCol: {
            span: 4
        },
        wrapperCol: {
            span: 20
        },
        colon: undefined,
        validateOnRuleChange: true
    }
    
  • Reference: Form props (opens new window)

# option.row

  • TypeObject

  • Description:Form component layout configuration

  • Defaults:

    {
        gutter: 0,
        type: undefined,
        align: undefined,
        justify: undefined
    }
    
  • Reference: Row props (opens new window)

# option.submitBtn

  • TypeObject

  • Description:Submit button style and layout configuration

  • Defaults:

    {
        disabled: false,
        ghost: false,
        icon: 'upload',
        loading: false,
        shape: UNDEF,
        size: UNDEF,
        type: 'primary',
        block: true,
        innerText: '提交',
        htmlType: UNDEF,
        show: true,
        col: UNDEF,
        click: UNDEF,
    }
    

    To configure the submit button, set 'Submit BTN = false' or 'submit' Btn.show=false `The button is not displayed

  • Reference: Layout | Button_props (opens new window)

# option.resetBtn

  • TypeObject

  • Description:Reset button style and layout configuration

  • Defaults:

    {
        disabled: false,
        ghost: false,
        icon: 'sync',
        loading: false,
        shape: UNDEF,
        size: UNDEF,
        type: 'default',
        block: true,
        innerText: '重置',
        htmlType: UNDEF,
        show: false,
        col: UNDEF,
        click: UNDEF
    }
    

    Reset button default configuration, set 'reset BTN = true' or 'reset' Btn.show=true `Show when

  • Reference: Layout | Button_props (opens new window)

# option.info v0.0.4+

  • TypeObject

  • Description:Component prompt message configuration

  • Defaults:

    {
      //Type,popover,tooltip
      type: "popover",
      placement: 'topLeft',
      icon: 'question-circle-o'
    }
    

    You can set the properties of the prompt component in the 'info' configuration item

  • Reference: Popover_props (opens new window) | Tooltip_props (opens new window)