Commit be68baecb1910fe3469b6ba6a9d77628aaf0ab0e

Authored by ly525
1 parent 4eaec2d6

chore: move common props definition of component to https://github.com/luban-h…

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