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