提交 | 用户 | 时间
|
e57a89
|
1 |
const styles = { |
懒 |
2 |
'el-rate': '.el-rate{display: inline-block; vertical-align: text-top;}', |
|
3 |
'el-upload': '.el-upload__tip{line-height: 1.2;}' |
|
4 |
} |
|
5 |
|
|
6 |
function addCss(cssList, el) { |
|
7 |
const css = styles[el.tag] |
|
8 |
css && cssList.indexOf(css) === -1 && cssList.push(css) |
|
9 |
if (el.children) { |
|
10 |
el.children.forEach(el2 => addCss(cssList, el2)) |
|
11 |
} |
|
12 |
} |
|
13 |
|
|
14 |
export function makeUpCss(conf) { |
|
15 |
const cssList = [] |
|
16 |
conf.fields.forEach(el => addCss(cssList, el)) |
|
17 |
return cssList.join('\n') |
|
18 |
} |