From 97c67d3a35172864d60a75b410642ff8669efb5d Mon Sep 17 00:00:00 2001 From: sam Date: Tue, 17 Aug 2021 15:47:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20bug=20=E4=BF=AE=E5=A4=8D=E6=89=93?= =?UTF-8?q?=E5=8C=85=E5=90=8E=E6=8A=A5=E9=94=99=20TypeError:=20le.addRoute?= =?UTF-8?q?=20is=20not=20a=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原因是本地开发阶段引用的是npm包中的vue-router,与打包后externals中CDN载入的vue-router版本不一致导致的。 --- vue.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vue.config.js b/vue.config.js index febdc7f3b4..f7b44c096a 100644 --- a/vue.config.js +++ b/vue.config.js @@ -31,7 +31,7 @@ const assetsCDN = { // https://unpkg.com/browse/vue@2.6.10/ js: [ '//cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.min.js', - '//cdn.jsdelivr.net/npm/vue-router@3.1.3/dist/vue-router.min.js', + '//cdn.jsdelivr.net/npm/vue-router@3.5.1/dist/vue-router.min.js', '//cdn.jsdelivr.net/npm/vuex@3.1.1/dist/vuex.min.js', '//cdn.jsdelivr.net/npm/axios@0.21.1/dist/axios.min.js' ]