You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ta...@apache.org on 2017/07/28 09:11:50 UTC

[11/43] incubator-weex git commit: * [html5] scan style when async component is loaded.

* [html5] scan style when async component is loaded.


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

Branch: refs/heads/0.16-dev
Commit: adac876414eb9214e7fa18930651f30fe4a42a58
Parents: 5537878
Author: MrRaindrop <te...@gmail.com>
Authored: Fri Jul 14 11:11:05 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Fri Jul 14 11:11:05 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/mixins/style.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/adac8764/html5/render/vue/mixins/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/style.js b/html5/render/vue/mixins/style.js
index 5be2edc..647119d 100644
--- a/html5/render/vue/mixins/style.js
+++ b/html5/render/vue/mixins/style.js
@@ -44,7 +44,9 @@ function getIdentifiedBeforeCreate () {
      * For vue-loader ^11.3.x, there's no injectStyle function. The styleSheet
      * is already injected into the head. Just scan it.
      */
-    if (this === this.$root && this.$options && !this._firstScanned) {
+    // async component.
+    if ((this.$vnode && this.$vnode.data && this.$vnode.data.tag === 'component')
+      || (this === this.$root && this.$options && !this._firstScanned)) {
       this._firstScanned = true
       extend(weex._styleMap, getHeadStyleMap())
     }