diff --git a/dist/vue-router.common.js b/dist/vue-router.common.js index c9eb5a168..5274e9acd 100644 --- a/dist/vue-router.common.js +++ b/dist/vue-router.common.js @@ -1,6 +1,6 @@ -/** - * vue-router v3.0.1 - * (c) 2017 Evan You +/*! + * vue-router v3.0.2 + * (c) 2018 Evan You * @license MIT */ 'use strict'; @@ -23,8 +23,15 @@ function isError (err) { return Object.prototype.toString.call(err).indexOf('Error') > -1 } +function extend (a, b) { + for (var key in b) { + a[key] = b[key]; + } + return a +} + var View = { - name: 'router-view', + name: 'RouterView', functional: true, props: { name: { @@ -38,6 +45,7 @@ var View = { var parent = ref.parent; var data = ref.data; + // used by devtools to display a router-view badge data.routerView = true; // directly use parent context's createElement() function @@ -112,7 +120,7 @@ var View = { return h(component, data, children) } -}; +} function resolveProps (route, config) { switch (typeof config) { @@ -135,13 +143,6 @@ function resolveProps (route, config) { } } -function extend (to, from) { - for (var key in from) { - to[key] = from[key]; - } - return to -} - /* */ var encodeReserveRE = /[!'()*]/g; @@ -240,7 +241,6 @@ function stringifyQuery (obj) { /* */ - var trailingSlashRE = /\/?$/; function createRoute ( @@ -383,7 +383,7 @@ var toTypes = [String, Object]; var eventTypes = [String, Array]; var Link = { - name: 'router-link', + name: 'RouterLink', props: { to: { type: toTypes, @@ -418,17 +418,17 @@ var Link = { var globalExactActiveClass = router.options.linkExactActiveClass; // Support global empty active class var activeClassFallback = globalActiveClass == null - ? 'router-link-active' - : globalActiveClass; + ? 'router-link-active' + : globalActiveClass; var exactActiveClassFallback = globalExactActiveClass == null - ? 'router-link-exact-active' - : globalExactActiveClass; + ? 'router-link-exact-active' + : globalExactActiveClass; var activeClass = this.activeClass == null - ? activeClassFallback - : this.activeClass; + ? activeClassFallback + : this.activeClass; var exactActiveClass = this.exactActiveClass == null - ? exactActiveClassFallback - : this.exactActiveClass; + ? exactActiveClassFallback + : this.exactActiveClass; var compareTarget = location.path ? createRoute(null, location, null, router) : route; @@ -468,7 +468,6 @@ var Link = { if (a) { // in case the is a static node a.isStatic = false; - var extend = _Vue.util.extend; var aData = a.data = extend({}, a.data); aData.on = on; var aAttrs = a.data.attrs = extend({}, a.data.attrs); @@ -481,7 +480,7 @@ var Link = { return h(this.tag, data, this.$slots.default) } -}; +} function guardEvent (e) { // don't redirect with control keys @@ -559,8 +558,8 @@ function install (Vue) { get: function get () { return this._routerRoot._route } }); - Vue.component('router-view', View); - Vue.component('router-link', Link); + Vue.component('RouterView', View); + Vue.component('RouterLink', Link); var strats = Vue.config.optionMergeStrategies; // use the same hook merging strategy for route hooks @@ -1070,7 +1069,6 @@ function pathToRegexp (path, keys, options) { return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options) } - pathToRegexp_1.parse = parse_1; pathToRegexp_1.compile = compile_1; pathToRegexp_1.tokensToFunction = tokensToFunction_1; @@ -1266,7 +1264,6 @@ function normalizePath (path, parent, strict) { /* */ - function normalizeLocation ( raw, current, @@ -1281,9 +1278,9 @@ function normalizeLocation ( // relative params if (!next.path && next.params && current) { - next = assign({}, next); + next = extend({}, next); next._normalized = true; - var params = assign(assign({}, current.params), next.params); + var params = extend(extend({}, current.params), next.params); if (current.name) { next.name = current.name; next.params = params; @@ -1321,16 +1318,10 @@ function normalizeLocation ( } } -function assign (a, b) { - for (var key in b) { - a[key] = b[key]; - } - return a -} - /* */ + function createMatcher ( routes, router @@ -1398,8 +1389,8 @@ function createMatcher ( ) { var originalRedirect = record.redirect; var redirect = typeof originalRedirect === 'function' - ? originalRedirect(createRoute(record, location, null, router)) - : originalRedirect; + ? originalRedirect(createRoute(record, location, null, router)) + : originalRedirect; if (typeof redirect === 'string') { redirect = { path: redirect }; @@ -1513,7 +1504,8 @@ function matchRoute ( var key = regex.keys[i - 1]; var val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i]; if (key) { - params[key.name] = val; + // Fix #1994: using * with props: true generates a param named 0 + params[key.name || 'pathMatch'] = val; } } @@ -1526,12 +1518,12 @@ function resolveRecordPath (path, record) { /* */ - var positionStore = Object.create(null); function setupScroll () { // Fix for #1585 for Firefox - window.history.replaceState({ key: getStateKey() }, ''); + // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678 + window.history.replaceState({ key: getStateKey() }, '', window.location.href.replace(window.location.origin, '')); window.addEventListener('popstate', function (e) { saveScrollPosition(); if (e.state && e.state.key) { @@ -1562,7 +1554,7 @@ function handleScroll ( // wait until re-render finishes before scrolling router.app.$nextTick(function () { var position = getScrollPosition(); - var shouldScroll = behavior(to, from, isPop ? position : null); + var shouldScroll = behavior.call(router, to, from, isPop ? position : null); if (!shouldScroll) { return @@ -2124,7 +2116,10 @@ function poll ( key, isValid ) { - if (instances[key]) { + if ( + instances[key] && + !instances[key]._isBeingDestroyed // do not reuse being destroyed instance + ) { cb(instances[key]); } else if (isValid()) { setTimeout(function () { @@ -2135,7 +2130,6 @@ function poll ( /* */ - var HTML5History = (function (History$$1) { function HTML5History (router, base) { var this$1 = this; @@ -2143,8 +2137,9 @@ var HTML5History = (function (History$$1) { History$$1.call(this, router, base); var expectScroll = router.options.scrollBehavior; + var supportsScroll = supportsPushState && expectScroll; - if (expectScroll) { + if (supportsScroll) { setupScroll(); } @@ -2160,7 +2155,7 @@ var HTML5History = (function (History$$1) { } this$1.transitionTo(location, function (route) { - if (expectScroll) { + if (supportsScroll) { handleScroll(router, route, current, true); } }); @@ -2214,7 +2209,7 @@ var HTML5History = (function (History$$1) { }(History)); function getLocation (base) { - var path = window.location.pathname; + var path = decodeURI(window.location.pathname); if (base && path.indexOf(base) === 0) { path = path.slice(base.length); } @@ -2223,7 +2218,6 @@ function getLocation (base) { /* */ - var HashHistory = (function (History$$1) { function HashHistory (router, base, fallback) { History$$1.call(this, router, base); @@ -2333,7 +2327,7 @@ function getHash () { // consistent across browsers - Firefox will pre-decode it! var href = window.location.href; var index = href.indexOf('#'); - return index === -1 ? '' : href.slice(index + 1) + return index === -1 ? '' : decodeURI(href.slice(index + 1)) } function getUrl (path) { @@ -2361,7 +2355,6 @@ function replaceHash (path) { /* */ - var AbstractHistory = (function (History$$1) { function AbstractHistory (router, base) { History$$1.call(this, router, base); @@ -2420,6 +2413,8 @@ var AbstractHistory = (function (History$$1) { /* */ + + var VueRouter = function VueRouter (options) { if ( options === void 0 ) options = {}; @@ -2616,7 +2611,7 @@ function createHref (base, fullPath, mode) { } VueRouter.install = install; -VueRouter.version = '3.0.1'; +VueRouter.version = '3.0.2'; if (inBrowser && window.Vue) { window.Vue.use(VueRouter); diff --git a/dist/vue-router.esm.js b/dist/vue-router.esm.js index 130c26b94..77d5e8b0a 100644 --- a/dist/vue-router.esm.js +++ b/dist/vue-router.esm.js @@ -1,6 +1,6 @@ -/** - * vue-router v3.0.1 - * (c) 2017 Evan You +/*! + * vue-router v3.0.2 + * (c) 2018 Evan You * @license MIT */ /* */ @@ -21,8 +21,15 @@ function isError (err) { return Object.prototype.toString.call(err).indexOf('Error') > -1 } +function extend (a, b) { + for (var key in b) { + a[key] = b[key]; + } + return a +} + var View = { - name: 'router-view', + name: 'RouterView', functional: true, props: { name: { @@ -36,6 +43,7 @@ var View = { var parent = ref.parent; var data = ref.data; + // used by devtools to display a router-view badge data.routerView = true; // directly use parent context's createElement() function @@ -110,7 +118,7 @@ var View = { return h(component, data, children) } -}; +} function resolveProps (route, config) { switch (typeof config) { @@ -133,13 +141,6 @@ function resolveProps (route, config) { } } -function extend (to, from) { - for (var key in from) { - to[key] = from[key]; - } - return to -} - /* */ var encodeReserveRE = /[!'()*]/g; @@ -238,7 +239,6 @@ function stringifyQuery (obj) { /* */ - var trailingSlashRE = /\/?$/; function createRoute ( @@ -381,7 +381,7 @@ var toTypes = [String, Object]; var eventTypes = [String, Array]; var Link = { - name: 'router-link', + name: 'RouterLink', props: { to: { type: toTypes, @@ -416,17 +416,17 @@ var Link = { var globalExactActiveClass = router.options.linkExactActiveClass; // Support global empty active class var activeClassFallback = globalActiveClass == null - ? 'router-link-active' - : globalActiveClass; + ? 'router-link-active' + : globalActiveClass; var exactActiveClassFallback = globalExactActiveClass == null - ? 'router-link-exact-active' - : globalExactActiveClass; + ? 'router-link-exact-active' + : globalExactActiveClass; var activeClass = this.activeClass == null - ? activeClassFallback - : this.activeClass; + ? activeClassFallback + : this.activeClass; var exactActiveClass = this.exactActiveClass == null - ? exactActiveClassFallback - : this.exactActiveClass; + ? exactActiveClassFallback + : this.exactActiveClass; var compareTarget = location.path ? createRoute(null, location, null, router) : route; @@ -466,7 +466,6 @@ var Link = { if (a) { // in case the is a static node a.isStatic = false; - var extend = _Vue.util.extend; var aData = a.data = extend({}, a.data); aData.on = on; var aAttrs = a.data.attrs = extend({}, a.data.attrs); @@ -479,7 +478,7 @@ var Link = { return h(this.tag, data, this.$slots.default) } -}; +} function guardEvent (e) { // don't redirect with control keys @@ -557,8 +556,8 @@ function install (Vue) { get: function get () { return this._routerRoot._route } }); - Vue.component('router-view', View); - Vue.component('router-link', Link); + Vue.component('RouterView', View); + Vue.component('RouterLink', Link); var strats = Vue.config.optionMergeStrategies; // use the same hook merging strategy for route hooks @@ -1068,7 +1067,6 @@ function pathToRegexp (path, keys, options) { return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options) } - pathToRegexp_1.parse = parse_1; pathToRegexp_1.compile = compile_1; pathToRegexp_1.tokensToFunction = tokensToFunction_1; @@ -1264,7 +1262,6 @@ function normalizePath (path, parent, strict) { /* */ - function normalizeLocation ( raw, current, @@ -1279,9 +1276,9 @@ function normalizeLocation ( // relative params if (!next.path && next.params && current) { - next = assign({}, next); + next = extend({}, next); next._normalized = true; - var params = assign(assign({}, current.params), next.params); + var params = extend(extend({}, current.params), next.params); if (current.name) { next.name = current.name; next.params = params; @@ -1319,16 +1316,10 @@ function normalizeLocation ( } } -function assign (a, b) { - for (var key in b) { - a[key] = b[key]; - } - return a -} - /* */ + function createMatcher ( routes, router @@ -1396,8 +1387,8 @@ function createMatcher ( ) { var originalRedirect = record.redirect; var redirect = typeof originalRedirect === 'function' - ? originalRedirect(createRoute(record, location, null, router)) - : originalRedirect; + ? originalRedirect(createRoute(record, location, null, router)) + : originalRedirect; if (typeof redirect === 'string') { redirect = { path: redirect }; @@ -1511,7 +1502,8 @@ function matchRoute ( var key = regex.keys[i - 1]; var val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i]; if (key) { - params[key.name] = val; + // Fix #1994: using * with props: true generates a param named 0 + params[key.name || 'pathMatch'] = val; } } @@ -1524,12 +1516,12 @@ function resolveRecordPath (path, record) { /* */ - var positionStore = Object.create(null); function setupScroll () { // Fix for #1585 for Firefox - window.history.replaceState({ key: getStateKey() }, ''); + // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678 + window.history.replaceState({ key: getStateKey() }, '', window.location.href.replace(window.location.origin, '')); window.addEventListener('popstate', function (e) { saveScrollPosition(); if (e.state && e.state.key) { @@ -1560,7 +1552,7 @@ function handleScroll ( // wait until re-render finishes before scrolling router.app.$nextTick(function () { var position = getScrollPosition(); - var shouldScroll = behavior(to, from, isPop ? position : null); + var shouldScroll = behavior.call(router, to, from, isPop ? position : null); if (!shouldScroll) { return @@ -2122,7 +2114,10 @@ function poll ( key, isValid ) { - if (instances[key]) { + if ( + instances[key] && + !instances[key]._isBeingDestroyed // do not reuse being destroyed instance + ) { cb(instances[key]); } else if (isValid()) { setTimeout(function () { @@ -2133,7 +2128,6 @@ function poll ( /* */ - var HTML5History = (function (History$$1) { function HTML5History (router, base) { var this$1 = this; @@ -2141,8 +2135,9 @@ var HTML5History = (function (History$$1) { History$$1.call(this, router, base); var expectScroll = router.options.scrollBehavior; + var supportsScroll = supportsPushState && expectScroll; - if (expectScroll) { + if (supportsScroll) { setupScroll(); } @@ -2158,7 +2153,7 @@ var HTML5History = (function (History$$1) { } this$1.transitionTo(location, function (route) { - if (expectScroll) { + if (supportsScroll) { handleScroll(router, route, current, true); } }); @@ -2212,7 +2207,7 @@ var HTML5History = (function (History$$1) { }(History)); function getLocation (base) { - var path = window.location.pathname; + var path = decodeURI(window.location.pathname); if (base && path.indexOf(base) === 0) { path = path.slice(base.length); } @@ -2221,7 +2216,6 @@ function getLocation (base) { /* */ - var HashHistory = (function (History$$1) { function HashHistory (router, base, fallback) { History$$1.call(this, router, base); @@ -2331,7 +2325,7 @@ function getHash () { // consistent across browsers - Firefox will pre-decode it! var href = window.location.href; var index = href.indexOf('#'); - return index === -1 ? '' : href.slice(index + 1) + return index === -1 ? '' : decodeURI(href.slice(index + 1)) } function getUrl (path) { @@ -2359,7 +2353,6 @@ function replaceHash (path) { /* */ - var AbstractHistory = (function (History$$1) { function AbstractHistory (router, base) { History$$1.call(this, router, base); @@ -2418,6 +2411,8 @@ var AbstractHistory = (function (History$$1) { /* */ + + var VueRouter = function VueRouter (options) { if ( options === void 0 ) options = {}; @@ -2614,7 +2609,7 @@ function createHref (base, fullPath, mode) { } VueRouter.install = install; -VueRouter.version = '3.0.1'; +VueRouter.version = '3.0.2'; if (inBrowser && window.Vue) { window.Vue.use(VueRouter); diff --git a/dist/vue-router.js b/dist/vue-router.js index 3285a7699..c20aa9f2b 100644 --- a/dist/vue-router.js +++ b/dist/vue-router.js @@ -1,6 +1,6 @@ -/** - * vue-router v3.0.1 - * (c) 2017 Evan You +/*! + * vue-router v3.0.2 + * (c) 2018 Evan You * @license MIT */ (function (global, factory) { @@ -27,8 +27,15 @@ function isError (err) { return Object.prototype.toString.call(err).indexOf('Error') > -1 } +function extend (a, b) { + for (var key in b) { + a[key] = b[key]; + } + return a +} + var View = { - name: 'router-view', + name: 'RouterView', functional: true, props: { name: { @@ -42,6 +49,7 @@ var View = { var parent = ref.parent; var data = ref.data; + // used by devtools to display a router-view badge data.routerView = true; // directly use parent context's createElement() function @@ -116,7 +124,7 @@ var View = { return h(component, data, children) } -}; +} function resolveProps (route, config) { switch (typeof config) { @@ -139,13 +147,6 @@ function resolveProps (route, config) { } } -function extend (to, from) { - for (var key in from) { - to[key] = from[key]; - } - return to -} - /* */ var encodeReserveRE = /[!'()*]/g; @@ -244,7 +245,6 @@ function stringifyQuery (obj) { /* */ - var trailingSlashRE = /\/?$/; function createRoute ( @@ -387,7 +387,7 @@ var toTypes = [String, Object]; var eventTypes = [String, Array]; var Link = { - name: 'router-link', + name: 'RouterLink', props: { to: { type: toTypes, @@ -422,17 +422,17 @@ var Link = { var globalExactActiveClass = router.options.linkExactActiveClass; // Support global empty active class var activeClassFallback = globalActiveClass == null - ? 'router-link-active' - : globalActiveClass; + ? 'router-link-active' + : globalActiveClass; var exactActiveClassFallback = globalExactActiveClass == null - ? 'router-link-exact-active' - : globalExactActiveClass; + ? 'router-link-exact-active' + : globalExactActiveClass; var activeClass = this.activeClass == null - ? activeClassFallback - : this.activeClass; + ? activeClassFallback + : this.activeClass; var exactActiveClass = this.exactActiveClass == null - ? exactActiveClassFallback - : this.exactActiveClass; + ? exactActiveClassFallback + : this.exactActiveClass; var compareTarget = location.path ? createRoute(null, location, null, router) : route; @@ -472,7 +472,6 @@ var Link = { if (a) { // in case the is a static node a.isStatic = false; - var extend = _Vue.util.extend; var aData = a.data = extend({}, a.data); aData.on = on; var aAttrs = a.data.attrs = extend({}, a.data.attrs); @@ -485,7 +484,7 @@ var Link = { return h(this.tag, data, this.$slots.default) } -}; +} function guardEvent (e) { // don't redirect with control keys @@ -563,8 +562,8 @@ function install (Vue) { get: function get () { return this._routerRoot._route } }); - Vue.component('router-view', View); - Vue.component('router-link', Link); + Vue.component('RouterView', View); + Vue.component('RouterLink', Link); var strats = Vue.config.optionMergeStrategies; // use the same hook merging strategy for route hooks @@ -1074,7 +1073,6 @@ function pathToRegexp (path, keys, options) { return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options) } - pathToRegexp_1.parse = parse_1; pathToRegexp_1.compile = compile_1; pathToRegexp_1.tokensToFunction = tokensToFunction_1; @@ -1270,7 +1268,6 @@ function normalizePath (path, parent, strict) { /* */ - function normalizeLocation ( raw, current, @@ -1285,9 +1282,9 @@ function normalizeLocation ( // relative params if (!next.path && next.params && current) { - next = assign({}, next); + next = extend({}, next); next._normalized = true; - var params = assign(assign({}, current.params), next.params); + var params = extend(extend({}, current.params), next.params); if (current.name) { next.name = current.name; next.params = params; @@ -1325,16 +1322,10 @@ function normalizeLocation ( } } -function assign (a, b) { - for (var key in b) { - a[key] = b[key]; - } - return a -} - /* */ + function createMatcher ( routes, router @@ -1402,8 +1393,8 @@ function createMatcher ( ) { var originalRedirect = record.redirect; var redirect = typeof originalRedirect === 'function' - ? originalRedirect(createRoute(record, location, null, router)) - : originalRedirect; + ? originalRedirect(createRoute(record, location, null, router)) + : originalRedirect; if (typeof redirect === 'string') { redirect = { path: redirect }; @@ -1517,7 +1508,8 @@ function matchRoute ( var key = regex.keys[i - 1]; var val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i]; if (key) { - params[key.name] = val; + // Fix #1994: using * with props: true generates a param named 0 + params[key.name || 'pathMatch'] = val; } } @@ -1530,12 +1522,12 @@ function resolveRecordPath (path, record) { /* */ - var positionStore = Object.create(null); function setupScroll () { // Fix for #1585 for Firefox - window.history.replaceState({ key: getStateKey() }, ''); + // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678 + window.history.replaceState({ key: getStateKey() }, '', window.location.href.replace(window.location.origin, '')); window.addEventListener('popstate', function (e) { saveScrollPosition(); if (e.state && e.state.key) { @@ -1566,7 +1558,7 @@ function handleScroll ( // wait until re-render finishes before scrolling router.app.$nextTick(function () { var position = getScrollPosition(); - var shouldScroll = behavior(to, from, isPop ? position : null); + var shouldScroll = behavior.call(router, to, from, isPop ? position : null); if (!shouldScroll) { return @@ -2128,7 +2120,10 @@ function poll ( key, isValid ) { - if (instances[key]) { + if ( + instances[key] && + !instances[key]._isBeingDestroyed // do not reuse being destroyed instance + ) { cb(instances[key]); } else if (isValid()) { setTimeout(function () { @@ -2139,7 +2134,6 @@ function poll ( /* */ - var HTML5History = (function (History$$1) { function HTML5History (router, base) { var this$1 = this; @@ -2147,8 +2141,9 @@ var HTML5History = (function (History$$1) { History$$1.call(this, router, base); var expectScroll = router.options.scrollBehavior; + var supportsScroll = supportsPushState && expectScroll; - if (expectScroll) { + if (supportsScroll) { setupScroll(); } @@ -2164,7 +2159,7 @@ var HTML5History = (function (History$$1) { } this$1.transitionTo(location, function (route) { - if (expectScroll) { + if (supportsScroll) { handleScroll(router, route, current, true); } }); @@ -2218,7 +2213,7 @@ var HTML5History = (function (History$$1) { }(History)); function getLocation (base) { - var path = window.location.pathname; + var path = decodeURI(window.location.pathname); if (base && path.indexOf(base) === 0) { path = path.slice(base.length); } @@ -2227,7 +2222,6 @@ function getLocation (base) { /* */ - var HashHistory = (function (History$$1) { function HashHistory (router, base, fallback) { History$$1.call(this, router, base); @@ -2337,7 +2331,7 @@ function getHash () { // consistent across browsers - Firefox will pre-decode it! var href = window.location.href; var index = href.indexOf('#'); - return index === -1 ? '' : href.slice(index + 1) + return index === -1 ? '' : decodeURI(href.slice(index + 1)) } function getUrl (path) { @@ -2365,7 +2359,6 @@ function replaceHash (path) { /* */ - var AbstractHistory = (function (History$$1) { function AbstractHistory (router, base) { History$$1.call(this, router, base); @@ -2424,6 +2417,8 @@ var AbstractHistory = (function (History$$1) { /* */ + + var VueRouter = function VueRouter (options) { if ( options === void 0 ) options = {}; @@ -2620,7 +2615,7 @@ function createHref (base, fullPath, mode) { } VueRouter.install = install; -VueRouter.version = '3.0.1'; +VueRouter.version = '3.0.2'; if (inBrowser && window.Vue) { window.Vue.use(VueRouter); diff --git a/dist/vue-router.min.js b/dist/vue-router.min.js index 867a9787b..9f921eda1 100644 --- a/dist/vue-router.min.js +++ b/dist/vue-router.min.js @@ -1,6 +1,6 @@ -/** - * vue-router v3.0.1 - * (c) 2017 Evan You +/*! + * vue-router v3.0.2 + * (c) 2018 Evan You * @license MIT */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueRouter=e()}(this,function(){"use strict";function t(t,e){}function e(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}function r(t,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(t);case"boolean":return e?t.params:void 0}}function n(t,e){for(var r in e)t[r]=e[r];return t}function o(t,e,r){void 0===e&&(e={});var n,o=r||i;try{n=o(t||"")}catch(t){n={}}for(var a in e)n[a]=e[a];return n}function i(t){var e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach(function(t){var r=t.replace(/\+/g," ").split("="),n=Ut(r.shift()),o=r.length>0?Ut(r.join("=")):null;void 0===e[n]?e[n]=o:Array.isArray(e[n])?e[n].push(o):e[n]=[e[n],o]}),e):e}function a(t){var e=t?Object.keys(t).map(function(e){var r=t[e];if(void 0===r)return"";if(null===r)return Pt(e);if(Array.isArray(r)){var n=[];return r.forEach(function(t){void 0!==t&&(null===t?n.push(Pt(e)):n.push(Pt(e)+"="+Pt(t)))}),n.join("&")}return Pt(e)+"="+Pt(r)}).filter(function(t){return t.length>0}).join("&"):null;return e?"?"+e:""}function u(t,e,r,n){var o=n&&n.options.stringifyQuery,i=e.query||{};try{i=c(i)}catch(t){}var a={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:i,params:e.params||{},fullPath:p(e,o),matched:t?s(t):[]};return r&&(a.redirectedFrom=p(r,o)),Object.freeze(a)}function c(t){if(Array.isArray(t))return t.map(c);if(t&&"object"==typeof t){var e={};for(var r in t)e[r]=c(t[r]);return e}return t}function s(t){for(var e=[];t;)e.unshift(t),t=t.parent;return e}function p(t,e){var r=t.path,n=t.query;void 0===n&&(n={});var o=t.hash;void 0===o&&(o="");var i=e||a;return(r||"/")+i(n)+o}function f(t,e){return e===Ht?t===e:!!e&&(t.path&&e.path?t.path.replace(Mt,"")===e.path.replace(Mt,"")&&t.hash===e.hash&&h(t.query,e.query):!(!t.name||!e.name)&&(t.name===e.name&&t.hash===e.hash&&h(t.query,e.query)&&h(t.params,e.params)))}function h(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!t||!e)return t===e;var r=Object.keys(t),n=Object.keys(e);return r.length===n.length&&r.every(function(r){var n=t[r],o=e[r];return"object"==typeof n&&"object"==typeof o?h(n,o):String(n)===String(o)})}function l(t,e){return 0===t.path.replace(Mt,"/").indexOf(e.path.replace(Mt,"/"))&&(!e.hash||t.hash===e.hash)&&d(t.query,e.query)}function d(t,e){for(var r in e)if(!(r in t))return!1;return!0}function y(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||t.defaultPrevented||void 0!==t.button&&0!==t.button)){if(t.currentTarget&&t.currentTarget.getAttribute){var e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function v(t){if(t)for(var e,r=0;r=0&&(e=t.slice(n),t=t.slice(0,n));var o=t.indexOf("?");return o>=0&&(r=t.slice(o+1),t=t.slice(0,o)),{path:t,query:r,hash:e}}function w(t){return t.replace(/\/\//g,"/")}function x(t,e){for(var r,n=[],o=0,i=0,a="",u=e&&e.delimiter||"/";null!=(r=Qt.exec(t));){var c=r[0],s=r[1],p=r.index;if(a+=t.slice(i,p),i=p+c.length,s)a+=s[1];else{var f=t[i],h=r[2],l=r[3],d=r[4],y=r[5],v=r[6],m=r[7];a&&(n.push(a),a="");var g=null!=h&&null!=f&&f!==h,b="+"===v||"*"===v,w="?"===v||"*"===v,x=r[2]||u,k=d||y;n.push({name:l||o++,prefix:h||"",delimiter:x,optional:w,repeat:b,partial:g,asterisk:!!m,pattern:k?C(k):m?".*":"[^"+O(x)+"]+?"})}}return i-1&&(o.params[h]=r.params[h]);if(u)return o.path=L(u.path,o.params,'named route "'+a+'"'),i(u,o,n)}else if(o.path){o.params={};for(var l=0;l=t.length?r():t[o]?e(t[o],function(){n(o+1)}):n(o+1)};n(0)}function at(t){return function(r,n,o){var i=!1,a=0,u=null;ut(t,function(t,r,n,c){if("function"==typeof t&&void 0===t.cid){i=!0,a++;var s,p=pt(function(e){st(e)&&(e=e.default),t.resolved="function"==typeof e?e:Tt.extend(e),n.components[c]=e,--a<=0&&o()}),f=pt(function(t){var r="Failed to resolve async component "+c+": "+t;u||(u=e(t)?t:new Error(r),o(u))});try{s=t(p,f)}catch(t){f(t)}if(s)if("function"==typeof s.then)s.then(p,f);else{var h=s.component;h&&"function"==typeof h.then&&h.then(p,f)}}}),i||o()}}function ut(t,e){return ct(t.map(function(t){return Object.keys(t.components).map(function(r){return e(t.components[r],t.instances[r],t,r)})}))}function ct(t){return Array.prototype.concat.apply([],t)}function st(t){return t.__esModule||te&&"Module"===t[Symbol.toStringTag]}function pt(t){var e=!1;return function(){for(var r=[],n=arguments.length;n--;)r[n]=arguments[n];if(!e)return e=!0,t.apply(this,r)}}function ft(t){if(!t)if(Bt){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";return"/"!==t.charAt(0)&&(t="/"+t),t.replace(/\/$/,"")}function ht(t,e){var r,n=Math.max(t.length,e.length);for(r=0;r=0?e.slice(0,r):e)+"#"+t}function Ct(t){Wt?nt(Ot(t)):window.location.hash=t}function jt(t){Wt?ot(Ot(t)):window.location.replace(Ot(t))}function At(t,e){return t.push(e),function(){var r=t.indexOf(e);r>-1&&t.splice(r,1)}}function _t(t,e,r){var n="hash"===r?"#"+e:e;return t?w(t+"/"+n):n}var Tt,St={name:"router-view",functional:!0,props:{name:{type:String,default:"default"}},render:function(t,e){var o=e.props,i=e.children,a=e.parent,u=e.data;u.routerView=!0;for(var c=a.$createElement,s=o.name,p=a.$route,f=a._routerViewCache||(a._routerViewCache={}),h=0,l=!1;a&&a._routerRoot!==a;)a.$vnode&&a.$vnode.data.routerView&&h++,a._inactive&&(l=!0),a=a.$parent;if(u.routerViewDepth=h,l)return c(f[s],u,i);var d=p.matched[h];if(!d)return f[s]=null,c();var y=f[s]=d.components[s];u.registerRouteInstance=function(t,e){var r=d.instances[s];(e&&r!==t||!e&&r===t)&&(d.instances[s]=e)},(u.hook||(u.hook={})).prepatch=function(t,e){d.instances[s]=e.componentInstance};var v=u.props=r(p,d.props&&d.props[s]);if(v){v=u.props=n({},v);var m=u.attrs=u.attrs||{};for(var g in v)y.props&&g in y.props||(m[g]=v[g],delete v[g])}return c(y,u,i)}},$t=/[!'()*]/g,qt=function(t){return"%"+t.charCodeAt(0).toString(16)},Lt=/%2C/g,Pt=function(t){return encodeURIComponent(t).replace($t,qt).replace(Lt,",")},Ut=decodeURIComponent,Mt=/\/?$/,Ht=u(null,{path:"/"}),It=[String,Object],Vt=[String,Array],zt={name:"router-link",props:{to:{type:It,required:!0},tag:{type:String,default:"a"},exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,event:{type:Vt,default:"click"}},render:function(t){var e=this,r=this.$router,n=this.$route,o=r.resolve(this.to,n,this.append),i=o.location,a=o.route,c=o.href,s={},p=r.options.linkActiveClass,h=r.options.linkExactActiveClass,d=null==p?"router-link-active":p,m=null==h?"router-link-exact-active":h,g=null==this.activeClass?d:this.activeClass,b=null==this.exactActiveClass?m:this.exactActiveClass,w=i.path?u(null,i,null,r):a;s[b]=f(n,w),s[g]=this.exact?s[b]:l(n,w);var x=function(t){y(t)&&(e.replace?r.replace(i):r.push(i))},k={click:y};Array.isArray(this.event)?this.event.forEach(function(t){k[t]=x}):k[this.event]=x;var R={class:s};if("a"===this.tag)R.on=k,R.attrs={href:c};else{var E=v(this.$slots.default);if(E){E.isStatic=!1;var O=Tt.util.extend;(E.data=O({},E.data)).on=k,(E.data.attrs=O({},E.data.attrs)).href=c}else R.on=k}return t(this.tag,R,this.$slots.default)}},Bt="undefined"!=typeof window,Ft=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},Dt=q,Kt=x,Jt=E,Nt=$,Qt=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");Dt.parse=Kt,Dt.compile=function(t,e){return E(x(t,e))},Dt.tokensToFunction=Jt,Dt.tokensToRegExp=Nt;var Xt=Object.create(null),Yt=Object.create(null),Wt=Bt&&function(){var t=window.navigator.userAgent;return(-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&(window.history&&"pushState"in window.history)}(),Gt=Bt&&window.performance&&window.performance.now?window.performance:Date,Zt=tt(),te="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,ee=function(t,e){this.router=t,this.base=ft(e),this.current=Ht,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[]};ee.prototype.listen=function(t){this.cb=t},ee.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},ee.prototype.onError=function(t){this.errorCbs.push(t)},ee.prototype.transitionTo=function(t,e,r){var n=this,o=this.router.match(t,this.current);this.confirmTransition(o,function(){n.updateRoute(o),e&&e(o),n.ensureURL(),n.ready||(n.ready=!0,n.readyCbs.forEach(function(t){t(o)}))},function(t){r&&r(t),t&&!n.ready&&(n.ready=!0,n.readyErrorCbs.forEach(function(e){e(t)}))})},ee.prototype.confirmTransition=function(r,n,o){var i=this,a=this.current,u=function(r){e(r)&&(i.errorCbs.length?i.errorCbs.forEach(function(t){t(r)}):(t(!1,"uncaught error during route navigation:"),console.error(r))),o&&o(r)};if(f(r,a)&&r.matched.length===a.matched.length)return this.ensureURL(),u();var c=ht(this.current.matched,r.matched),s=c.updated,p=c.deactivated,h=c.activated,l=[].concat(yt(p),this.router.beforeHooks,vt(s),h.map(function(t){return t.beforeEnter}),at(h));this.pending=r;var d=function(t,n){if(i.pending!==r)return u();try{t(r,a,function(t){!1===t||e(t)?(i.ensureURL(!0),u(t)):"string"==typeof t||"object"==typeof t&&("string"==typeof t.path||"string"==typeof t.name)?(u(),"object"==typeof t&&t.replace?i.replace(t):i.push(t)):n(t)})}catch(t){u(t)}};it(l,d,function(){var t=[];it(gt(h,t,function(){return i.current===r}).concat(i.router.resolveHooks),d,function(){if(i.pending!==r)return u();i.pending=null,n(r),i.router.app&&i.router.app.$nextTick(function(){t.forEach(function(t){t()})})})})},ee.prototype.updateRoute=function(t){var e=this.current;this.current=t,this.cb&&this.cb(t),this.router.afterHooks.forEach(function(r){r&&r(t,e)})};var re=function(t){function e(e,r){var n=this;t.call(this,e,r);var o=e.options.scrollBehavior;o&&D();var i=xt(this.base);window.addEventListener("popstate",function(t){var r=n.current,a=xt(n.base);n.current===Ht&&a===i||n.transitionTo(a,function(t){o&&K(e,t,r,!0)})})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,function(t){nt(w(n.base+t.fullPath)),K(n.router,t,o,!1),e&&e(t)},r)},e.prototype.replace=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,function(t){ot(w(n.base+t.fullPath)),K(n.router,t,o,!1),e&&e(t)},r)},e.prototype.ensureURL=function(t){if(xt(this.base)!==this.current.fullPath){var e=w(this.base+this.current.fullPath);t?nt(e):ot(e)}},e.prototype.getCurrentLocation=function(){return xt(this.base)},e}(ee),ne=function(t){function e(e,r,n){t.call(this,e,r),n&&kt(this.base)||Rt()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this,e=this.router.options.scrollBehavior,r=Wt&&e;r&&D(),window.addEventListener(Wt?"popstate":"hashchange",function(){var e=t.current;Rt()&&t.transitionTo(Et(),function(n){r&&K(t.router,n,e,!0),Wt||jt(n.fullPath)})})},e.prototype.push=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,function(t){Ct(t.fullPath),K(n.router,t,o,!1),e&&e(t)},r)},e.prototype.replace=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,function(t){jt(t.fullPath),K(n.router,t,o,!1),e&&e(t)},r)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;Et()!==e&&(t?Ct(e):jt(e))},e.prototype.getCurrentLocation=function(){return Et()},e}(ee),oe=function(t){function e(e,r){t.call(this,e,r),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,r){var n=this;this.transitionTo(t,function(t){n.stack=n.stack.slice(0,n.index+1).concat(t),n.index++,e&&e(t)},r)},e.prototype.replace=function(t,e,r){var n=this;this.transitionTo(t,function(t){n.stack=n.stack.slice(0,n.index).concat(t),e&&e(t)},r)},e.prototype.go=function(t){var e=this,r=this.index+t;if(!(r<0||r>=this.stack.length)){var n=this.stack[r];this.confirmTransition(n,function(){e.index=r,e.updateRoute(n)})}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(ee),ie=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=z(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!Wt&&!1!==t.fallback,this.fallback&&(e="hash"),Bt||(e="abstract"),this.mode=e,e){case"history":this.history=new re(this,t.base);break;case"hash":this.history=new ne(this,t.base,this.fallback);break;case"abstract":this.history=new oe(this,t.base)}},ae={currentRoute:{configurable:!0}};return ie.prototype.match=function(t,e,r){return this.matcher.match(t,e,r)},ae.currentRoute.get=function(){return this.history&&this.history.current},ie.prototype.init=function(t){var e=this;if(this.apps.push(t),!this.app){this.app=t;var r=this.history;if(r instanceof re)r.transitionTo(r.getCurrentLocation());else if(r instanceof ne){var n=function(){r.setupListeners()};r.transitionTo(r.getCurrentLocation(),n,n)}r.listen(function(t){e.apps.forEach(function(e){e._route=t})})}},ie.prototype.beforeEach=function(t){return At(this.beforeHooks,t)},ie.prototype.beforeResolve=function(t){return At(this.resolveHooks,t)},ie.prototype.afterEach=function(t){return At(this.afterHooks,t)},ie.prototype.onReady=function(t,e){this.history.onReady(t,e)},ie.prototype.onError=function(t){this.history.onError(t)},ie.prototype.push=function(t,e,r){this.history.push(t,e,r)},ie.prototype.replace=function(t,e,r){this.history.replace(t,e,r)},ie.prototype.go=function(t){this.history.go(t)},ie.prototype.back=function(){this.go(-1)},ie.prototype.forward=function(){this.go(1)},ie.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map(function(t){return Object.keys(t.components).map(function(e){return t.components[e]})})):[]},ie.prototype.resolve=function(t,e,r){var n=I(t,e||this.history.current,r,this),o=this.match(n,e),i=o.redirectedFrom||o.fullPath;return{location:n,route:o,href:_t(this.history.base,i,this.mode),normalizedTo:n,resolved:o}},ie.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==Ht&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(ie.prototype,ae),ie.install=m,ie.version="3.0.1",Bt&&window.Vue&&window.Vue.use(ie),ie}); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueRouter=e()}(this,function(){"use strict";function l(t){return-1=e.length?n():e[t]?r(e[t],function(){o(t+1)}):o(t+1)};o(0)}function st(r){return function(t,e,c){var s=!1,p=0,f=null;pt(r,function(r,t,n,o){if("function"==typeof r&&void 0===r.cid){s=!0,p++;var e,i=lt(function(t){var e;((e=t).__esModule||ht&&"Module"===e[Symbol.toStringTag])&&(t=t.default),r.resolved="function"==typeof t?t:d.extend(t),n.components[o]=t,--p<=0&&c()}),a=lt(function(t){var e="Failed to resolve async component "+o+": "+t;f||(f=l(t)?t:new Error(e),c(f))});try{e=r(i,a)}catch(t){a(t)}if(e)if("function"==typeof e.then)e.then(i,a);else{var u=e.component;u&&"function"==typeof u.then&&u.then(i,a)}}}),s||c()}}function pt(t,r){return ft(t.map(function(e){return Object.keys(e.components).map(function(t){return r(e.components[t],e.instances[t],e,t)})}))}function ft(t){return Array.prototype.concat.apply([],t)}var ht="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function lt(r){var n=!1;return function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];if(!n)return n=!0,r.apply(this,t)}}var dt=function(t,e){this.router=t,this.base=function(t){if(!t)if(m){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=s,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[]};function yt(t,i,a,e){var r=pt(t,function(t,e,r,n){var o=function(t,e){"function"!=typeof t&&(t=d.extend(t));return t.options[e]}(t,i);if(o)return Array.isArray(o)?o.map(function(t){return a(t,e,r,n)}):a(o,e,r,n)});return ft(e?r.reverse():r)}function vt(t,e){if(e)return function(){return t.apply(e,arguments)}}dt.prototype.listen=function(t){this.cb=t},dt.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},dt.prototype.onError=function(t){this.errorCbs.push(t)},dt.prototype.transitionTo=function(t,e,r){var n=this,o=this.router.match(t,this.current);this.confirmTransition(o,function(){n.updateRoute(o),e&&e(o),n.ensureURL(),n.ready||(n.ready=!0,n.readyCbs.forEach(function(t){t(o)}))},function(e){r&&r(e),e&&!n.ready&&(n.ready=!0,n.readyErrorCbs.forEach(function(t){t(e)}))})},dt.prototype.confirmTransition=function(r,e,t){var n=this,o=this.current,i=function(e){l(e)&&(n.errorCbs.length?n.errorCbs.forEach(function(t){t(e)}):console.error(e)),t&&t(e)};if(O(r,o)&&r.matched.length===o.matched.length)return this.ensureURL(),i();var a=function(t,e){var r,n=Math.max(t.length,e.length);for(r=0;r=this.stack.length)){var n=this.stack[r];this.confirmTransition(n,function(){e.index=r,e.updateRoute(n)})}},t.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},t.prototype.ensureURL=function(){},t}(dt),Ct=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=F(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!et&&!1!==t.fallback,this.fallback&&(e="hash"),m||(e="abstract"),this.mode=e){case"history":this.history=new mt(this,t.base);break;case"hash":this.history=new bt(this,t.base,this.fallback);break;case"abstract":this.history=new Ot(this,t.base)}},jt={currentRoute:{configurable:!0}};function At(e,r){return e.push(r),function(){var t=e.indexOf(r);-1