Skip to content

Commit

Permalink
fix: support for array type class #322
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjinzhou committed Dec 19, 2018
1 parent 6d32836 commit ae1f924
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/_util/props-util.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import isPlainObject from 'lodash/isPlainObject'

import classNames from 'classnames'
function getType (fn) {
const match = fn && fn.toString().match(/^\s*function (\w+)/)
return match ? match[1] : ''
Expand Down Expand Up @@ -184,6 +184,8 @@ export function getClass (ele) {
let cls = {}
if (typeof tempCls === 'string') {
tempCls.split(' ').forEach(c => { cls[c.trim()] = true })
} else if (Array.isArray(tempCls)) {
classNames(tempCls).split(' ').forEach(c => { cls[c.trim()] = true })
} else {
cls = tempCls
}
Expand Down

0 comments on commit ae1f924

Please sign in to comment.