Skip to content

Commit ae1f924

Browse files
committed
fix: support for array type class #322
1 parent 6d32836 commit ae1f924

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/_util/props-util.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import isPlainObject from 'lodash/isPlainObject'
2-
2+
import classNames from 'classnames'
33
function getType (fn) {
44
const match = fn && fn.toString().match(/^\s*function (\w+)/)
55
return match ? match[1] : ''
@@ -184,6 +184,8 @@ export function getClass (ele) {
184184
let cls = {}
185185
if (typeof tempCls === 'string') {
186186
tempCls.split(' ').forEach(c => { cls[c.trim()] = true })
187+
} else if (Array.isArray(tempCls)) {
188+
classNames(tempCls).split(' ').forEach(c => { cls[c.trim()] = true })
187189
} else {
188190
cls = tempCls
189191
}

0 commit comments

Comments
 (0)