Browse Source

fix(weex): support data class type that is string (#9139)

close #9124
dev
Zhenfei You 6 years ago
committed by Evan You
parent
commit
d8285c57a6
  1. 2
      src/platforms/weex/runtime/modules/class.js

2
src/platforms/weex/runtime/modules/class.js

@ -44,6 +44,8 @@ function makeClassList (data: VNodeData): Array<string> {
classList.push.apply(classList, dataClass)
} else if (isObject(dataClass)) {
classList.push.apply(classList, Object.keys(dataClass).filter(className => dataClass[className]))
} else if (typeof dataClass === 'string') {
classList.push.apply(classList, dataClass.trim().split(/\s+/))
}
return classList
}

Loading…
Cancel
Save