* [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.12-dev Commit: 5ce1c113138937c177d9266c953b023f292ad05f Parents: afed7f7 Author: MrRaindrop <tekk...@gmail.com> Authored: Fri Apr 21 11:08:14 2017 +0800 Committer: MrRaindrop <tekk...@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) },