From b48bbac695dabec9160d947f9b27b2d91028c455 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Sun, 29 Jul 2018 19:33:41 +0800 Subject: [PATCH] chore: update classname --- components/_util/vnode.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/_util/vnode.js b/components/_util/vnode.js index a7e40ec983..06b6235a10 100644 --- a/components/_util/vnode.js +++ b/components/_util/vnode.js @@ -84,13 +84,12 @@ export function cloneElement (n, nodeProps, deep) { style = { ...style, ...tempStyle } } - if (typeof data.class === 'string') { - cls[data.class] = true + if (typeof data.class === 'string' && data.class.trim() !== '') { data.class.split(' ').forEach(c => { cls[c.trim()] = true }) } else { cls = { ...data.class, ...cls } } - if (typeof tempCls === 'string') { + if (typeof tempCls === 'string' && tempCls.trim() !== '') { tempCls.split(' ').forEach(c => { cls[c.trim()] = true }) } else { cls = { ...cls, ...tempCls }