import snippets from './snippets'; export default { snippets, componentName: 'Typography.Paragraph', title: '段落', category: '基础', group: '基础组件', props: [ { name: 'children', title: { label: '内容', tip: 'children | 内容' }, propType: 'string', defaultValue: '', setter: 'TextAreaSetter', }, { name: 'code', title: { label: '添加代码样式', tip: 'code | 添加代码样式' }, propType: 'bool', defaultValue: false, }, { name: 'copyable', title: { label: '是否可拷贝', tip: 'copyable | 是否可拷贝,为对象时可进行各种自定义', }, propType: 'bool', defaultValue: false, }, { name: 'copyOrigin', title: { label: '是否拷贝原字段', tip: 'copyOrigin | 是否拷贝原由字段,不对字段做任何处理', }, propType: 'bool', defaultValue: false, condition: { type: 'JSFunction', value: 'target => !!target.getProps().getPropValue("copyable")', }, }, { name: 'delete', title: { label: '添加删除线样式', tip: 'delete | 添加删除线样式' }, propType: 'bool', defaultValue: false, }, { name: 'disabled', title: { label: '是否禁用', tip: 'disabled | 是否为禁用状态' }, propType: 'bool', defaultValue: false, }, { name: 'editable', title: { label: '是否可编辑', tip: 'editable | 是否可编辑' }, propType: 'bool', defaultValue: false, }, { name: 'ellipsis', title: { label: '自动溢出省略', tip: 'ellipsis | 自动溢出省略' }, propType: 'bool', defaultValue: false, }, { name: 'mark', title: { label: '添加标记样式', tip: 'mark | 添加标记样式' }, propType: 'bool', defaultValue: false, }, { name: 'underline', title: { label: '添加下划线样式', tip: 'underline | 添加下划线样式' }, propType: 'bool', defaultValue: false, }, { name: 'onChange', title: { label: '当用户提交编辑内容时触发', tip: 'onChange | 当用户提交编辑内容时触发', }, propType: 'func', }, { name: 'strong', title: { label: '是否加粗', tip: 'strong | 是否加粗' }, propType: 'bool', defaultValue: false, }, { name: 'type', title: { label: '文本类型', tip: 'type | 文本类型' }, propType: { type: 'oneOf', value: ['default', 'secondary', 'success', 'warning', 'danger'], }, setter: { componentName: 'SelectSetter', props: { options: [ { title: '默认', value: 'default', }, { title: '弱提示', value: 'secondary', }, { title: '成功', value: 'success', }, { title: '警告', value: 'warning', }, { title: '错误', value: 'danger', }, ], }, }, }, ], configure: { supports: { style: true, events: [ { name: 'onClick', description: '点击 Paragraph 时的回调', template: "\tonClick(event, ${extParams}){\n\t\t// 点击 Paragraph 时的回调\n\t\tconsole.log('onClick', event);\n\t}\n", }, { name: 'copyable.onCopy', description: '拷贝成功的回调函数', template: "\tonCopy(${extParams}){\n\t\t// 拷贝成功的回调函数\n\t\tconsole.log('onCopy');\n\t}\n", }, { name: 'editable.onStart', description: '进入编辑中状态时触发', template: "\tonStart(${extParams}){\n\t\t// 进入编辑中状态时触发\n\t\tconsole.log('onStart');\n\t}\n", }, { name: 'editable.onChange', description: '文本域编辑时触发', template: "\tonEditableChange(value,${extParams}){\n\t\t// 文本域编辑时触发\n\t\tconsole.log('onEditableChange', value);\n\t}\n", }, { name: 'editable.onEnd', description: '按 ENTER 结束编辑状态时触发', template: "\tonEnd(${extParams}){\n\t\t// 按 ENTER 结束编辑状态时触发\n\t\tconsole.log('onEnd');\n\t}\n", }, { name: 'editable.onCancel', description: '按 ESC 退出编辑状态时触发', template: "\tonCancel(${extParams}){\n\t\t// 按 ESC 退出编辑状态时触发\n\t\tconsole.log('onCancel');\n\t}\n", }, { name: 'ellipsis.onEllipsis', description: '触发省略时的回调', template: "\tonEllipsis(ellipsis,${extParams}){\n\t\t// 触发省略时的回调\n\t\tconsole.log('onEllipsis', ellipsis);\n\t}\n", }, { name: 'ellipsis.onExpand', description: '点击展开时的回调', template: "\tonExpand(event,${extParams}){\n\t\t// 点击展开时的回调\n\t\tconsole.log('onExpand', event);\n\t}\n", }, ], }, }, };