import { IPublicModelSettingField } from '@alilc/lowcode-types'; import snippets from './snippets'; import { RequiredSetter, RsStringSetter } from '../_setters'; import { uuid } from '../_utils/utils'; import { version } from '../../package.json'; export default { snippets, title: '图片展示', componentName: 'RsLogo', // 组件名称 可用于搜索 docUrl: '', // 组件文档链接 group: '基础组件', // 用于描述当前组件位于组件面板的哪一个tab category: '基础元素', // 用于描述当前组件位于组件面板统一tab的哪个区域 devMode: 'proCode', // 组件研发模式 priority: 26, // 用于描述组件在统一category中的排序 npm: { // npm源引入完整描述对象 package: 'components-page', // 源码组件库名 version, // 源码组件版本号 exportName: 'RsLogo', // 源码组件名称 main: 'src\\index.tsx', // 源码组件路径 destructuring: true, // 解构 subName: '', // 子组件名称 }, configure: { props: [ { name: 'rs_id', title: { label: { type: 'i18n', zh_CN: '组件ID', en_US: 'id', }, tip: { type: 'i18n', zh_CN: '属性: id | 说明: 字段唯一识别', en_US: 'prop: id | description: field ID', }, }, propType: 'string', setter: { componentName: RequiredSetter, initialValue: () => `image_${uuid()}`, }, extraProps: { setValue: (target: IPublicModelSettingField, value: any) => { if (!value) return; target.getProps().setPropValue('ref', value); }, }, }, { name: 'src', title: { label: '图片路径', tip: 'src | 图片路径' }, setter: { componentName: RsStringSetter, }, }, { name: 'width', title: { label: '宽度', tip: 'width | 宽度' }, propType: { type: 'oneOfType', value: ['number', 'string'], }, defaultValue: 120, setter: [ { componentName: 'NumberSetter', }, { componentName: RsStringSetter, }, ], }, { name: 'alt', title: { label: '图像描述', tip: 'alt | 图像描述' }, defaultValue: '图片', setter: { componentName: RsStringSetter, }, }, ], supports: { style: true, events: [ { name: 'onClick', template: "onClick(e){\n\t\t// 点击logo事件\n\t\tconsole.log('onClick',e);\n\t}\n", }, ], }, }, };