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/02/20 06:40:53 UTC

[04/50] [abbrv] incubator-weex git commit: * [html5] set default page to index.

* [html5] set default page to index.


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

Branch: refs/heads/master
Commit: 2fc724d2ca78ec42de98be098e4c11626f0cc316
Parents: 71b3cbe
Author: MrRaindrop <te...@gmail.com>
Authored: Thu Feb 16 10:32:12 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Thu Feb 16 10:32:12 2017 +0800

----------------------------------------------------------------------
 vue.html | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2fc724d2/vue.html
----------------------------------------------------------------------
diff --git a/vue.html b/vue.html
index adba6c1..a7fb765 100644
--- a/vue.html
+++ b/vue.html
@@ -24,7 +24,15 @@
         return match && match[1]
       }
 
-      var page = getUrlParam('page') || 'examples/build/vue-web/vue/index.js'
+      var page = getUrlParam('page')
+      var defaultPage = 'examples/build/vue-web/vue/index.js'
+      if (!page) {
+        var url = location.href.replace(/\?|$/, function(f) {
+          var query = '?page=' + defaultPage
+          return f ? query + '&' : query
+        })
+        location.href = url
+      }
 
       var bundle = document.createElement('script')
       bundle.src = page