# 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

Additional configuration items are supported in global configuration

  • form: The overall display rule configuration of the form
  • 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:

    {
      inline: false,
      labelPosition: 'right',
      labelSuffix: undefined,
      hideRequiredAsterisk: false,
      labelWidth: '125px',
      showMessage: true,
      inlineMessage: false,
      statusIcon: false,
      validateOnRuleChange: true,
      disabled: false,
      size: undefined,
    }
    
  • Reference: Form props (opens new window)

# option.row

  • TypeObject

  • Description:Form component layout configuration

  • Defaults:

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

# option.submitBtn

  • TypeObject

  • Description:Submit button style and layout configuration

  • Defaults:

    {
      type: "primary",
      size: "medium",
      plain: false,
      round: false,
      circle: false,
      loading: false,
      disabled: false,
      icon: 'el-icon-upload',
      width: '100%',
      autofocus: false,
      nativeType: "button",
      innerText: "提交",
      show: true,
      col: undefined,
      click: undefined,
    }
    

    Submit button configuration, do not show the button when submitBtn = false or submitBtn.show = false

  • Reference: Layout | Button_props (opens new window)

# option.resetBtn

  • TypeObject

  • Description:Reset button style and layout configuration

  • Defaults:

    {
      type: "default",
      size: "medium",
      plain: false,
      round: false,
      circle: false,
      loading: false,
      disabled: false,
      icon: 'el-icon-refresh',
      width: '100%',
      autofocus: false,
      nativeType: "button",
      innerText: "重置",
      show: false,
      col: undefined,
      click: undefined,
    }
    

    Reset button default configuration, displayed when resetBtn = true or resetBtn.show = true

  • Reference: Layout | Button_props (opens new window)

# option.info

  • TypeObject

  • Description:Component prompt message configuration

  • Defaults:

    {
      type:"popover"
    }
    

The properties of the prompt component can be set in the info configuration item

# option.wrap v2.5.0+