chore: update classname

pull/165/head
tangjinzhou 2018-07-29 19:33:41 +08:00
parent a3f61ef00a
commit e4b4aba25e
1 changed files with 2 additions and 3 deletions

View File

@ -84,13 +84,12 @@ export function cloneElement (n, nodeProps, deep) {
style = { ...style, ...tempStyle } style = { ...style, ...tempStyle }
} }
if (typeof data.class === 'string') { if (typeof data.class === 'string' && data.class.trim() !== '') {
cls[data.class] = true
data.class.split(' ').forEach(c => { cls[c.trim()] = true }) data.class.split(' ').forEach(c => { cls[c.trim()] = true })
} else { } else {
cls = { ...data.class, ...cls } cls = { ...data.class, ...cls }
} }
if (typeof tempCls === 'string') { if (typeof tempCls === 'string' && tempCls.trim() !== '') {
tempCls.split(' ').forEach(c => { cls[c.trim()] = true }) tempCls.split(' ').forEach(c => { cls[c.trim()] = true })
} else { } else {
cls = { ...cls, ...tempCls } cls = { ...cls, ...tempCls }