import type { MaterialDefinition } from '@/schema/materials.ts' import TextMaterial from './component.vue' const textMaterial: MaterialDefinition = { name: '文本', icon: 'solar:text-bold', group: 'info', setters: [ { type: 'input', label: '内容', key: 'props.content', }, { type: 'color', label: '颜色', key: 'style.color', }, ], schema: { type: 'text', name: '文本', layout: { x: 0, y: 0, width: 200, height: 50, }, style: { color: 'red', }, props: { content: '文本内容123123', }, }, } export function install(register: (material: MaterialDefinition, component: Component) => void) { // 注册文本物料 register(textMaterial, TextMaterial) }