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/03/31 07:28:49 UTC

[14/50] [abbrv] incubator-weex git commit: * [html5] add warning for .

* [html5] add warning for .


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

Branch: refs/heads/0.12-dev
Commit: 7b8a6ba3355ea4cbb591841f91bf6f1b4ea1d761
Parents: 611f41e
Author: MrRaindrop <te...@gmail.com>
Authored: Thu Mar 23 18:03:39 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Thu Mar 23 18:03:39 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/mixins/base.js  | 13 +++++++++++++
 html5/render/vue/mixins/style.js |  1 +
 2 files changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/7b8a6ba3/html5/render/vue/mixins/base.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/base.js b/html5/render/vue/mixins/base.js
index 76a06f0..09b5cc9 100644
--- a/html5/render/vue/mixins/base.js
+++ b/html5/render/vue/mixins/base.js
@@ -23,6 +23,16 @@ function watchLazyload () {
   })
 }
 
+let warned = false
+const notePage = 'https://github.com/MrRaindrop/weex/blob/html5-feature-vue-render-process-style/build/webpack.examples.web.config.js#L70-L89'
+function warnProcessStyle () {
+  if (!warned) {
+    warned = true
+    console.error(`[vue-render] warn: should add loader config using $processStyle to enable`
+      + ` inline styles's auto-prefixing. see ${notePage}`)
+  }
+}
+
 export default {
   beforeCreate () {
     if (!lazyloadWatched) {
@@ -38,6 +48,9 @@ export default {
       weex._root = this.$root.$el
       weex._root.classList.add('weex-root')
     }
+    if (!warned && !window._style_processing_added) {
+      warnProcessStyle()
+    }
     watchAppear(this)
     if (process.env.NODE_ENV === 'development') {
       tagMounted()

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/7b8a6ba3/html5/render/vue/mixins/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/style.js b/html5/render/vue/mixins/style.js
index 6cf47cd..7338e5d 100644
--- a/html5/render/vue/mixins/style.js
+++ b/html5/render/vue/mixins/style.js
@@ -72,6 +72,7 @@ export default {
 
   methods: {
     $processStyle (style, hyphenated) {
+      window._style_processing_added = true
       if (window._process_style) {
         return window._process_style(style)
       }