From 11e2bc7321b219e10eae0c8bc12f6373672be879 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Wed, 8 Jan 2020 18:16:03 +0800 Subject: [PATCH] fix(h5-vue-router): remove Object.assign #1116 --- .../packages/h5-vue-router/dist/vue-router.common.js | 5 ++--- .../packages/h5-vue-router/dist/vue-router.esm.js | 5 ++--- .../packages/h5-vue-router/dist/vue-router.js | 5 ++--- .../packages/h5-vue-router/dist/vue-router.min.js | 4 ++-- 4 files changed, 8 insertions(+), 11 deletions(-) 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 b552c428d..c26ba4ebe 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 @@ -1,6 +1,6 @@ /*! * vue-router v3.0.1 - * (c) 2019 Evan You + * (c) 2020 Evan You * @license MIT */ 'use strict'; @@ -1325,7 +1325,6 @@ function normalizeLocation ( /* */ - function createMatcher ( routes, router @@ -1495,7 +1494,7 @@ function createMatcher ( if (record.meta.id) { record.components.default.name = record.meta.name + '-' + location.params.__id__; } else { - record = Object.assign({}, record); + record = extend({}, record); record.components = { 'default': { name: record.meta.name + '-' + location.params.__id__, 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 19ec64b2a..dee50aaab 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 @@ -1,6 +1,6 @@ /*! * vue-router v3.0.1 - * (c) 2019 Evan You + * (c) 2020 Evan You * @license MIT */ /* */ @@ -1323,7 +1323,6 @@ function normalizeLocation ( /* */ - function createMatcher ( routes, router @@ -1493,7 +1492,7 @@ function createMatcher ( if (record.meta.id) { record.components.default.name = record.meta.name + '-' + location.params.__id__; } else { - record = Object.assign({}, record); + record = extend({}, record); record.components = { 'default': { name: record.meta.name + '-' + location.params.__id__, 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 ef0d4d83f..b14fd7029 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 @@ -1,6 +1,6 @@ /*! * vue-router v3.0.1 - * (c) 2019 Evan You + * (c) 2020 Evan You * @license MIT */ (function (global, factory) { @@ -1329,7 +1329,6 @@ function normalizeLocation ( /* */ - function createMatcher ( routes, router @@ -1499,7 +1498,7 @@ function createMatcher ( if (record.meta.id) { record.components.default.name = record.meta.name + '-' + location.params.__id__; } else { - record = Object.assign({}, record); + record = extend({}, record); record.components = { 'default': { name: record.meta.name + '-' + location.params.__id__, 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 63223428f..4c22c7ef6 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 @@ -1,6 +1,6 @@ /*! * vue-router v3.0.1 - * (c) 2019 Evan You + * (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 ut(r){return function(t,e,u){var c=!1,p=0,f=null;ct(r,function(r,t,n,o){if("function"==typeof r&&void 0===r.cid){c=!0,p++;var e,i=ht(function(t){var e;((e=t).__esModule||ft&&"Module"===e[Symbol.toStringTag])&&(t=t.default),r.resolved="function"==typeof t?t:d.extend(t),n.components[o]=t,--p<=0&&u()}),a=ht(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 ct(t,r){return pt(t.map(function(e){return Object.keys(e.components).map(function(t){return r(e.components[t],e.instances[t],e,t)})}))}function pt(t){return Array.prototype.concat.apply([],t)}var ft="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function ht(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 lt=function(t,e){this.router=t,this.base=function(t){if(!t)if(y){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 dt(t,i,a,e){var r=ct(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 pt(e?r.reverse():r)}function yt(t,e){if(e)return function(){return t.apply(e,arguments)}}lt.prototype.listen=function(t){this.cb=t},lt.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},lt.prototype.onError=function(t){this.errorCbs.push(t)},lt.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)}))})},lt.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}(lt),Et=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=D(t.routes||[],this),this.id=t.id||1,this.minId=t.id||1;var e=t.mode||"hash";switch(this.fallback="history"===e&&!tt&&!1!==t.fallback,this.fallback&&(e="hash"),y||(e="abstract"),this.mode=e){case"history":this.history=new vt(this,t.base);break;case"hash":this.history=new gt(this,t.base,this.fallback);break;case"abstract":this.history=new kt(this,t.base)}},jt={currentRoute:{configurable:!0}};function Ot(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 ut(r){return function(t,e,u){var c=!1,p=0,f=null;ct(r,function(r,t,n,o){if("function"==typeof r&&void 0===r.cid){c=!0,p++;var e,i=ht(function(t){var e;((e=t).__esModule||ft&&"Module"===e[Symbol.toStringTag])&&(t=t.default),r.resolved="function"==typeof t?t:d.extend(t),n.components[o]=t,--p<=0&&u()}),a=ht(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 ct(t,r){return pt(t.map(function(e){return Object.keys(e.components).map(function(t){return r(e.components[t],e.instances[t],e,t)})}))}function pt(t){return Array.prototype.concat.apply([],t)}var ft="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function ht(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 lt=function(t,e){this.router=t,this.base=function(t){if(!t)if(y){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 dt(t,i,a,e){var r=ct(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 pt(e?r.reverse():r)}function yt(t,e){if(e)return function(){return t.apply(e,arguments)}}lt.prototype.listen=function(t){this.cb=t},lt.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},lt.prototype.onError=function(t){this.errorCbs.push(t)},lt.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)}))})},lt.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}(lt),Et=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=D(t.routes||[],this),this.id=t.id||1,this.minId=t.id||1;var e=t.mode||"hash";switch(this.fallback="history"===e&&!tt&&!1!==t.fallback,this.fallback&&(e="hash"),y||(e="abstract"),this.mode=e){case"history":this.history=new vt(this,t.base);break;case"hash":this.history=new gt(this,t.base,this.fallback);break;case"abstract":this.history=new kt(this,t.base)}},jt={currentRoute:{configurable:!0}};function Ot(e,r){return e.push(r),function(){var t=e.indexOf(r);-1