tmagic-editor
tmagic-editor copied to clipboard
请问如何给自定义组件自定义一个新的属性类型
比如创建了一个新的组件, 想要定义一个原有类型之外的属性,像下面这样应该怎么弄
// formConfig.js
export default [
{
type: 'custom-type',
text: '自定义属性'
name: 'xxx'
},
{
name: 'text',
text: '配置文案',
}
];
参考这里面 https://github.com/Tencent/tmagic-editor/tree/master/packages/form/src/fields 的组件自定义一个组件,然后在编辑器所在的项目中全局注册,app.component('m-fields-xxxx', xx); 其中xxxx就是type