tmagic-editor icon indicating copy to clipboard operation
tmagic-editor copied to clipboard

请问如何给自定义组件自定义一个新的属性类型

Open shadiniao opened this issue 8 months ago • 1 comments

比如创建了一个新的组件, 想要定义一个原有类型之外的属性,像下面这样应该怎么弄

// formConfig.js
export default [
  {
    type: 'custom-type',
    text: '自定义属性'
    name: 'xxx'
  },
  {
    name: 'text',
    text: '配置文案',
  }
];

shadiniao avatar Mar 31 '25 14:03 shadiniao

参考这里面 https://github.com/Tencent/tmagic-editor/tree/master/packages/form/src/fields 的组件自定义一个组件,然后在编辑器所在的项目中全局注册,app.component('m-fields-xxxx', xx); 其中xxxx就是type

jia000 avatar Apr 09 '25 03:04 jia000