Skip to content

Select 选择器

基础用法

ts
{
  id: '',
  componentName: 'Select',
  componentType: 'form',
  formItemAttrs: {
    field: '',
    label: '选择器',
  },
  attrs: {
    options: [
      {
        value: 'Option1',
        label: 'Option1',
      },
      {
        value: 'Option2',
        label: 'Option2',
      },
      {
        value: 'Option3',
        label: 'Option3',
      },
    ],
  },
}

基础多选

ts
{
  id: '',
  componentName: 'Select',
  componentType: 'form',
  formItemAttrs: {
    field: '',
    label: '选择器',
  },
  attrs: {
    multiple: true,
    'collapse-tags': true,
    'collapse-tags-tooltip': true,
    'max-collapse-tags': 3,
    options: [
      {
        value: 'Option1',
        label: 'Option1',
      },
      {
        value: 'Option2',
        label: 'Option2',
      },
      {
        value: 'Option3',
        label: 'Option3',
      },
    ],
  },
}

其他

ts
{
  id: '',
  componentName: 'Select',
  componentType: 'form',
  formItemAttrs: {
    field: '',
    label: '选择器',
  },
  attrs: {
    disabled: true, //禁用
    clearable: true,//可清空
    size:"large",//尺寸
    filterable: true,//筛选选项
    "allow-create": true, //创建新的选项
    options: [
      {
        value: 'Option1',
        label: 'Option1',
        disabled: true,//禁用
      },
      {
        value: 'Option2',
        label: 'Option2',
      },
      {
        value: 'Option3',
        label: 'Option3',
      },
    ],
  },
}

Released under the MIT License.