props.js
2.74 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
export default {
text: ({ defaultValue = '按钮', label = '按钮文字' } = {}) => ({
type: String,
default: defaultValue,
editor: {
type: 'a-input',
label,
require: true
}
}),
type: {
type: String,
default: 'text'
},
placeholder: ({ defaultValue = '请填写提示文字' } = {}) => ({
type: String,
default: defaultValue,
editor: {
type: 'a-input',
label: '提示文字',
require: true
}
}),
required: {
type: Boolean,
default: false
},
vertical: {
type: Boolean,
default: false
},
backgroundColor: {
type: String,
default: 'rgba(255, 255, 255, 0.2)',
editor: {
type: 'el-color-picker',
label: '背景颜色',
prop: {
size: 'mini',
showAlpha: true
},
require: true
}
},
color: {
type: String,
// 注意,根据 MDN 文档,颜色选择器的 value 只能是:# + 6个16进制字符串
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color#Value
// The value of an <input> element of type color is always a DOMString which contains a 7-character string specifying an RGB color in hexadecimal format.
default: '#000000',
editor: {
type: 'el-color-picker',
label: '文字颜色',
// !#zh 为编辑组件指定 prop
prop: {
size: 'mini',
showAlpha: true
},
require: true
}
},
fontSize: {
type: Number,
default: 14,
editor: {
type: 'a-input-number',
label: '字号(px)',
require: true,
prop: {
step: 1,
min: 12,
max: 144
}
}
},
lineHeight: {
type: Number,
default: 1,
editor: {
type: 'a-input-number',
label: '行高',
require: true,
prop: {
step: 0.1,
min: 0.1,
max: 10
}
}
},
borderWidth: {
type: Number,
default: 0,
editor: {
type: 'a-input-number',
label: '边框宽度(px)',
require: true,
prop: {
step: 1,
min: 0,
max: 10
}
}
},
borderRadius: {
type: Number,
default: 0,
editor: {
type: 'a-input-number',
label: '圆角(px)',
require: true,
prop: {
step: 0.1,
min: 0,
max: 200
}
}
},
borderColor: {
type: String,
default: '#ced4da',
editor: {
type: 'el-color-picker',
label: '边框颜色',
prop: {
size: 'mini',
showAlpha: true
},
require: true
}
},
textAlign: ({ defaultValue = 'center' } = {}) => ({
type: String,
default: defaultValue,
editor: {
type: 'lbs-text-align',
label: '文字对齐',
require: true
}
})
}