You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ji...@apache.org on 2017/03/31 02:44:20 UTC
[04/50] [abbrv] incubator-weex git commit: * [html5] fix styles bug.
* [html5] fix styles bug.
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/0a13ea1f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/0a13ea1f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/0a13ea1f
Branch: refs/heads/0.11-dev
Commit: 0a13ea1f5404267bd528959b14cb7e27e4477eff
Parents: 937c1ca
Author: MrRaindrop <te...@gmail.com>
Authored: Tue Mar 21 00:10:35 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue Mar 21 00:10:35 2017 +0800
----------------------------------------------------------------------
html5/render/vue/mixins/style.js | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0a13ea1f/html5/render/vue/mixins/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/style.js b/html5/render/vue/mixins/style.js
index bf00c0f..dca16a5 100644
--- a/html5/render/vue/mixins/style.js
+++ b/html5/render/vue/mixins/style.js
@@ -120,10 +120,8 @@ export default {
const wh = {}
const style = data.style
const staticStyle = data.staticStyle
- const classes = (data.class || '').split(' ')
- const staticClass = (data.staticClass || '').split(' ')
- // const classes = typeof data.class === 'string' ? [data.class] : (data.class || [])
- // const staticClass = typeof data.staticClass === 'string' ? [data.staticClass] : (data.staticClass || [])
+ const classes = typeof data.class === 'string' ? data.class.split(' ') : (data.class || [])
+ const staticClass = typeof data.staticClass === 'string' ? data.staticClass.split(' ') : (data.class || [])
const clsNms = staticClass.concat(classes)
function extendWHFrom (to, from) {
if (!from) { return }
@@ -138,10 +136,8 @@ export default {
// get style from class, staticClass, style and staticStyle.
_getComponentStyle (data) {
- const staticClassNames = (data.staticClass || '').split(' ')
- const classNames = (data.class || '').split(' ')
- // const staticClassNames = (typeof data.staticClass === 'string') ? [data.staticClass] : (data.staticClass || [])
- // const classNames = (typeof data.class === 'string') ? [data.class] : (data.class || [])
+ const staticClassNames = (typeof data.staticClass === 'string') ? data.staticClass.split(' ') : (data.staticClass || [])
+ const classNames = (typeof data.class === 'string') ? data.class.split(' ') : (data.class || [])
/**
* merge styles. priority: high -> low
* 1. data.style (bound style).