赞
踩
以auto-complete-widget为例
export const autoCompleteSchema = { type: 'auto-complete', icon: 'autocomplete', formItemFlag: true, options: { name: '', label: '', labelZh: '', labelAlign: '', type: 'text', defaultValue: '', placeholder: '', columnWidth: '200px', size: '', labelWidth: null, labelHidden: false, readonly: false, disabled: false, hidden: false, clearable: true, showPassword: false, required: false, requiredHint: '', validation: '', validationHint: '', optionItems: [], //------------------- customClass: '', //自定义css类名 labelIconClass: null, labelIconPosition: 'rear', labelTooltip: null, minLength: null, maxLength: null, showWordLimit: false, prefixIcon: '', suffixIcon: '', appendButton: false, appendButtonDisabled: false, buttonIcon: 'el-icon-search', //------------------- onMounted: '', onChange: '', }, }
export const loadExtension = function () { loadAutoCompleteWidget() } const loadAutoCompleteWidget = () => { /** * 加载字段组件步骤: * 1. 加载组件Json Schema; * 2. 全局注册字段组件,字段组件设计期和运行期共用,故需要仅需注册一个组件; * 3. 全局注册属性编辑器组件(基本属性、高级属性、事件属性); * 4. 注册字段组件的代码生成器; * 5. 加载完毕。 */ addCustomWidgetSchema(autoCompleteSchema) //加载组件Json Schema Vue.component(AutoCompleteWidget.name, AutoCompleteWidget) //注册组件 registerFWGenerator('autoComplete', autoCompleteTemplateGenerator) //注册字段组件的代码生成器 /* 字段组件加载完毕 end */ }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。