|
|
@@ -107,6 +107,18 @@ const layouts = {
|
|
107
|
107
|
}
|
|
108
|
108
|
|
|
109
|
109
|
const tags = {
|
|
|
110
|
+ 'el-button': el => {
|
|
|
111
|
+ const {
|
|
|
112
|
+ tag, disabled
|
|
|
113
|
+ } = attrBuilder(el)
|
|
|
114
|
+ const type = el.type ? `type="${el.type}"` : ''
|
|
|
115
|
+ const icon = el.icon ? `icon="${el.icon}"` : ''
|
|
|
116
|
+ const size = el.size ? `size="${el.size}"` : ''
|
|
|
117
|
+ let child = buildElButtonChild(el)
|
|
|
118
|
+
|
|
|
119
|
+ if (child) child = `\n${child}\n` // 换行
|
|
|
120
|
+ return `<${el.tag} ${type} ${icon} ${size} ${disabled}>${child}</${el.tag}>`
|
|
|
121
|
+ },
|
|
110
|
122
|
'el-input': el => {
|
|
111
|
123
|
const {
|
|
112
|
124
|
disabled, vModel, clearable, placeholder, width
|
|
|
@@ -272,6 +284,15 @@ function attrBuilder(el) {
|
|
272
|
284
|
}
|
|
273
|
285
|
}
|
|
274
|
286
|
|
|
|
287
|
+// el-buttin 子级
|
|
|
288
|
+function buildElButtonChild(conf) {
|
|
|
289
|
+ const children = []
|
|
|
290
|
+ if (conf.default) {
|
|
|
291
|
+ children.push(conf.default)
|
|
|
292
|
+ }
|
|
|
293
|
+ return children.join('\n')
|
|
|
294
|
+}
|
|
|
295
|
+
|
|
275
|
296
|
// el-input innerHTML
|
|
276
|
297
|
function buildElInputChild(conf) {
|
|
277
|
298
|
const children = []
|