/** * @file 编辑器扩展, 增加自定义插件(组件物料面板展示需要) */ // @ts-ignore import { registerPlugin } from 'vue3-aipage-widget'; const InfoCardPlugin = { name: 'uview表单', description: 'uview版表单组件示例', componentId: 'uni-form', id: 'uni-form', tags: ['uview组件'], // 组件分类 pluginIcon: 'cards-plugin', order: 1, // 展示顺序(从小到大展示) type: 'element', // 渲染器类型 device: ['mobile', 'app'], // 设置类型,目前支持3种类型: pc、mobile、app docLink: '', demoProperties: { componentId: 'uni-form', type: 'element', componentProperties: { data: {}, style: {}, }, }, events: [ { eventName: 'click', eventLabel: '点击事件1', }, { eventName: 'click2', eventLabel: '点击事件2', } ], panelControls: { type: 'tabs', tabs: [ { title: '属性', controls: [ { type: 'collapse', title: '数据', controls: [ { type: 'tpl', tpl: '暂无数据配置项', }, ], }, ], }, { title: '外观', controls: [ { title: '布局', type: 'collapse', controls: [ { type: 'button-icon-group', name: 'style.display', label: '显示', value: 'block', options: [ { label: '块级(block)', icon: 'block', value: 'block', }, { label: '行内区块(inline-block)', icon: 'inlineBlock', value: 'inline-block', }, { label: '行内元素(inline)', icon: 'inline', value: 'inline', }, ], }, { name: 'style', type: 'whSet', label: '宽度', options: [ { label: '', value: 'width', }, ], }, ], }, { type: 'collapse', title: '边距', controls: { name: 'style.box', type: 'boxModel', label: false, }, }, ], }, { title: '事件', body: [ { name: 'data.event', type: 'event', label: false, }, ], }, ], }, }; // 注册自定义插件(aipage-editor组件物料面板需要) registerPlugin(InfoCardPlugin); export default InfoCardPlugin;