|
|
@ -107,6 +107,18 @@ const layouts = { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const tags = { |
|
|
|
const tags = { |
|
|
|
|
|
|
|
'el-button': el => { |
|
|
|
|
|
|
|
const { |
|
|
|
|
|
|
|
tag, disabled |
|
|
|
|
|
|
|
} = attrBuilder(el) |
|
|
|
|
|
|
|
const type = el.type ? `type="${el.type}"` : '' |
|
|
|
|
|
|
|
const icon = el.icon ? `icon="${el.icon}"` : '' |
|
|
|
|
|
|
|
const size = el.size ? `size="${el.size}"` : '' |
|
|
|
|
|
|
|
let child = buildElButtonChild(el) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (child) child = `\n${child}\n` // 换行
|
|
|
|
|
|
|
|
return `<${el.tag} ${type} ${icon} ${size} ${disabled}>${child}</${el.tag}>` |
|
|
|
|
|
|
|
}, |
|
|
|
'el-input': el => { |
|
|
|
'el-input': el => { |
|
|
|
const { |
|
|
|
const { |
|
|
|
disabled, vModel, clearable, placeholder, width |
|
|
|
disabled, vModel, clearable, placeholder, width |
|
|
@ -272,6 +284,15 @@ function attrBuilder(el) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// el-buttin 子级
|
|
|
|
|
|
|
|
function buildElButtonChild(conf) { |
|
|
|
|
|
|
|
const children = [] |
|
|
|
|
|
|
|
if (conf.default) { |
|
|
|
|
|
|
|
children.push(conf.default) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return children.join('\n') |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// el-input innerHTML
|
|
|
|
// el-input innerHTML
|
|
|
|
function buildElInputChild(conf) { |
|
|
|
function buildElInputChild(conf) { |
|
|
|
const children = [] |
|
|
|
const children = [] |
|
|
|