1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
| import { generateUUID } from '@/utils'
| import { localeProps, makeRequiredRule } from '@/components/FormCreate/src/utils'
|
| export const useEditorRule = () => {
| const label = '富文本'
| const name = 'Editor'
| return {
| icon: 'icon-editor',
| label,
| name,
| rule() {
| return {
| type: name,
| field: generateUUID(),
| title: label,
| info: '',
| $required: false
| }
| },
| props(_, { t }) {
| return localeProps(t, name + '.props', [
| makeRequiredRule(),
| {
| type: 'input',
| field: 'height',
| title: '高度'
| },
| { type: 'switch', field: 'readonly', title: '是否只读' }
| ])
| }
| }
| }
|
|