diff --git a/packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.common.js b/packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.common.js index b2fdf57dada4787c4e661d64ab5354de1b0afef4..13510bae89b0ad1375e3af1d564732d7126b0035 100644 --- a/packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.common.js +++ b/packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.common.js @@ -2228,9 +2228,15 @@ var HTML5History = (function (History$$1) { HTML5History.prototype.push = function push (location, onComplete , onAbort ) { var this$1 = this; - if (typeof location === 'object') { // fixed by xxxxxx + if (typeof location === 'object') { // fixed by xxxxxx + location.params = location.params || {}; + var hasId = location.params.__id__; switch (location.type) { - case 'navigateTo': + case 'navigateTo': + if (!hasId) { + this.router.id++; + } + break case 'redirectTo': case 'reLaunch': this.router.id++; @@ -2238,8 +2244,9 @@ var HTML5History = (function (History$$1) { case 'switchTab': break } - location.params = location.params || {}; - location.params.__id__ = this.router.id; + if (!hasId) { + location.params.__id__ = this.router.id; + } } var ref = this; @@ -2369,9 +2376,15 @@ var HashHistory = (function (History$$1) { HashHistory.prototype.push = function push (location, onComplete , onAbort ) { var this$1 = this; - if (typeof location === 'object') { // fixed by xxxxxx + if (typeof location === 'object') { // fixed by xxxxxx + location.params = location.params || {}; + var hasId = location.params.__id__; switch (location.type) { - case 'navigateTo': + case 'navigateTo': + if (!hasId) { + this.router.id++; + } + break case 'redirectTo': case 'reLaunch': this.router.id++; @@ -2379,8 +2392,10 @@ var HashHistory = (function (History$$1) { case 'switchTab': break } - location.params = location.params || {}; - location.params.__id__ = this.router.id; + + if (!hasId) { + location.params.__id__ = this.router.id; + } } var ref = this; diff --git a/packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.esm.js b/packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.esm.js index 66c36cf43382e853c89931fd446afe11e69ad4b9..a29ea4bd46e5ba1cf679b42f4425c3858c50e8c4 100644 --- a/packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.esm.js +++ b/packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.esm.js @@ -2226,9 +2226,15 @@ var HTML5History = (function (History$$1) { HTML5History.prototype.push = function push (location, onComplete , onAbort ) { var this$1 = this; - if (typeof location === 'object') { // fixed by xxxxxx + if (typeof location === 'object') { // fixed by xxxxxx + location.params = location.params || {}; + var hasId = location.params.__id__; switch (location.type) { - case 'navigateTo': + case 'navigateTo': + if (!hasId) { + this.router.id++; + } + break case 'redirectTo': case 'reLaunch': this.router.id++; @@ -2236,8 +2242,9 @@ var HTML5History = (function (History$$1) { case 'switchTab': break } - location.params = location.params || {}; - location.params.__id__ = this.router.id; + if (!hasId) { + location.params.__id__ = this.router.id; + } } var ref = this; @@ -2367,9 +2374,15 @@ var HashHistory = (function (History$$1) { HashHistory.prototype.push = function push (location, onComplete , onAbort ) { var this$1 = this; - if (typeof location === 'object') { // fixed by xxxxxx + if (typeof location === 'object') { // fixed by xxxxxx + location.params = location.params || {}; + var hasId = location.params.__id__; switch (location.type) { - case 'navigateTo': + case 'navigateTo': + if (!hasId) { + this.router.id++; + } + break case 'redirectTo': case 'reLaunch': this.router.id++; @@ -2377,8 +2390,10 @@ var HashHistory = (function (History$$1) { case 'switchTab': break } - location.params = location.params || {}; - location.params.__id__ = this.router.id; + + if (!hasId) { + location.params.__id__ = this.router.id; + } } var ref = this; diff --git a/packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.js b/packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.js index 35d9b7572d90fcee81dc1ce1cd796c6f8fcfedcd..ffb58af8d05459937cbd2b13b5c5ddd44702b4ab 100644 --- a/packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.js +++ b/packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.js @@ -2232,9 +2232,15 @@ var HTML5History = (function (History$$1) { HTML5History.prototype.push = function push (location, onComplete , onAbort ) { var this$1 = this; - if (typeof location === 'object') { // fixed by xxxxxx + if (typeof location === 'object') { // fixed by xxxxxx + location.params = location.params || {}; + var hasId = location.params.__id__; switch (location.type) { - case 'navigateTo': + case 'navigateTo': + if (!hasId) { + this.router.id++; + } + break case 'redirectTo': case 'reLaunch': this.router.id++; @@ -2242,8 +2248,9 @@ var HTML5History = (function (History$$1) { case 'switchTab': break } - location.params = location.params || {}; - location.params.__id__ = this.router.id; + if (!hasId) { + location.params.__id__ = this.router.id; + } } var ref = this; @@ -2373,9 +2380,15 @@ var HashHistory = (function (History$$1) { HashHistory.prototype.push = function push (location, onComplete , onAbort ) { var this$1 = this; - if (typeof location === 'object') { // fixed by xxxxxx + if (typeof location === 'object') { // fixed by xxxxxx + location.params = location.params || {}; + var hasId = location.params.__id__; switch (location.type) { - case 'navigateTo': + case 'navigateTo': + if (!hasId) { + this.router.id++; + } + break case 'redirectTo': case 'reLaunch': this.router.id++; @@ -2383,8 +2396,10 @@ var HashHistory = (function (History$$1) { case 'switchTab': break } - location.params = location.params || {}; - location.params.__id__ = this.router.id; + + if (!hasId) { + location.params.__id__ = this.router.id; + } } var ref = this; diff --git a/packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.min.js b/packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.min.js index 90a5348eda91157701c36cef3ec36b0461cb1af6..ebfc2844bde0a096afee888d022adb7b8b18e5b9 100644 --- a/packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.min.js +++ b/packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.min.js @@ -3,4 +3,4 @@ * (c) 2020 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 l(t){return-1=e.length?n():e[t]?r(e[t],function(){o(t+1)}):o(t+1)};o(0)}function ct(r){return function(t,e,u){var c=!1,p=0,f=null;pt(r,function(r,t,n,o){if("function"==typeof r&&void 0===r.cid){c=!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&&u()}),a=lt(function(t){var e="Failed to resolve async component "+o+": "+t;f||(f=l(t)?t:new Error(e),u(f))});try{e=r(i,a)}catch(t){a(t)}if(e)if("function"==typeof e.then)e.then(i,a);else{var s=e.component;s&&"function"==typeof s.then&&s.then(i,a)}}}),c||u()}}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(v){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=O,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)},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),jt=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),this.id=t.id||1,this.minId=t.id||1;var e=t.mode||"hash";switch(this.fallback="history"===e&&!et&&!1!==t.fallback,this.fallback&&(e="hash"),v||(e="abstract"),this.mode=e){case"history":this.history=new mt(this,t.base);break;case"hash":this.history=new _t(this,t.base,this.fallback);break;case"abstract":this.history=new Et(this,t.base)}},Ot={currentRoute:{configurable:!0}};function Ct(e,r){return e.push(r),function(){var t=e.indexOf(r);-1=e.length?n():e[t]?r(e[t],function(){o(t+1)}):o(t+1)};o(0)}function ct(r){return function(t,e,u){var c=!1,p=0,f=null;pt(r,function(r,t,n,o){if("function"==typeof r&&void 0===r.cid){c=!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&&u()}),a=lt(function(t){var e="Failed to resolve async component "+o+": "+t;f||(f=l(t)?t:new Error(e),u(f))});try{e=r(i,a)}catch(t){a(t)}if(e)if("function"==typeof e.then)e.then(i,a);else{var s=e.component;s&&"function"==typeof s.then&&s.then(i,a)}}}),c||u()}}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(v){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=O,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)},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),jt=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),this.id=t.id||1,this.minId=t.id||1;var e=t.mode||"hash";switch(this.fallback="history"===e&&!et&&!1!==t.fallback,this.fallback&&(e="hash"),v||(e="abstract"),this.mode=e){case"history":this.history=new mt(this,t.base);break;case"hash":this.history=new _t(this,t.base,this.fallback);break;case"abstract":this.history=new Et(this,t.base)}},Ot={currentRoute:{configurable:!0}};function Ct(e,r){return e.push(r),function(){var t=e.indexOf(r);-1