You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by so...@apache.org on 2017/04/24 09:33:39 UTC

[21/51] [abbrv] incubator-weex git commit: * [html5] fix updating children style error.

* [html5] fix updating children style error.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/5ce1c113
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/5ce1c113
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/5ce1c113

Branch: refs/heads/0.13-dev
Commit: 5ce1c113138937c177d9266c953b023f292ad05f
Parents: afed7f7
Author: MrRaindrop <te...@gmail.com>
Authored: Fri Apr 21 11:08:14 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Fri Apr 21 11:08:14 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/mixins/base.js | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/5ce1c113/html5/render/vue/mixins/base.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/base.js b/html5/render/vue/mixins/base.js
index 819146e..f2ef32b 100644
--- a/html5/render/vue/mixins/base.js
+++ b/html5/render/vue/mixins/base.js
@@ -89,13 +89,21 @@ export default {
     if (process.env.NODE_ENV === 'development') {
       tagUpdated()
     }
-    if (this.$vnode && this.$vnode.data) {
-      const style = extractComponentStyle(this)
-      const el = this.$el
+    function remergeStyle (vm) {
+      const style = extractComponentStyle(vm)
+      const el = vm.$el
       if (style && el && el.nodeType !== 8) {
-        this.$el.style.cssText += toCSSText(style)
+        vm.$el.style.cssText += toCSSText(style)
       }
     }
+    const children = this.$children
+    if (children) {
+      children.forEach((childVm) => {
+        this.$nextTick(function () {
+          remergeStyle(childVm)
+        })
+      })
+    }
     watchAppear(this)
   },