配置

配置 类型 默认值 备注
type String 'normal' 参照类型:'normal'(普通参照) / 'senior'(高级参照)
multiple Boolean false 是否为多选
v-model String '' 参照值(多选以逗号分隔开)
suite-code String '' 套件标识
dict-type String '' 字典类型(标识)
placeholder String '请选择参照项' 占位文本
size String 'medium' 参考el-select的size配置
show-value-column Boolean false 高级参照时,是否显示取值列
popover-width Number 800 高级参照时,弹出层显示宽度
clearable Boolean false 显示清空按钮
disabled Boolean false 禁用
readonly Boolean false 只读
empty-text String '无' 只读时,数据为空的显示文字

使用方式

示例源码

<p-dict
  v-model="value"
  :type="form.type"
  :multiple="form.multiple"
  :suite-code="form.suiteCode"
  :dict-type="form.dictType"
  :placeholder="form.placeholder"
  :clearable="form.clearable"
  :size="form.size"
  :show-value-column="form.showValueColumn"
  :popover-width="form.popoverWidth"
  :disabled="form.disabled"
  :readonly="form.readonly"
  :empty-text="form.emptyText"
  style="width: 100%;">
</p-dict>
export default {
    data() {
      return {
        form: {
          type: 'normal',
          multiple: false,
          suiteCode: 'cn.flyrise.suite.a5f8f',
          dictType: 'lxl_test2',
          placeholder: '请选择参照项',
          clearable: false,
          size: 'medium',
          showValueColumn: false,
          popoverWidth: 800,
          disabled: false,
          readonly: false,
          emptyText: '无',
        },
        value: '',
      }
    },
    watch: {
      'form.type'() {
        this.form.dictType = { senior: 'testPark', normal: 'lxl_test2' }[this.form.type]
      },
    },
  }
文档更新时间: 2021-05-12 18:48   作者:管理员