From 3de2ffe3cc01c8f3e2e6c0b083f7f617e3746801 Mon Sep 17 00:00:00 2001 From: Guyi Date: Fri, 13 Aug 2021 14:45:39 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=EF=BC=8Cfin?= =?UTF-8?q?euiWithoutJqueryAndPolyfillJs=E4=B8=AD=E5=8A=A0=E4=B8=8Ah.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webpack/attachments.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webpack/attachments.js b/webpack/attachments.js index b141b9bf4..0515a809d 100644 --- a/webpack/attachments.js +++ b/webpack/attachments.js @@ -182,7 +182,8 @@ const fineuiIE = [].concat( const fineuiWithoutJqueryAndPolyfillJs = [].concat( sync([ - "src/core/foundation.js", + "src/core/0.foundation.js", + "src/core/h.js", lodashJs, "src/core/**/*.js", "src/data/**/*.js", From 9bb740305b345dbec538f07e476b2d451f7c49f9 Mon Sep 17 00:00:00 2001 From: Guyi Date: Mon, 23 Aug 2021 10:12:17 +0800 Subject: [PATCH 2/4] =?UTF-8?q?KERNEL-8279=20refactor=EF=BC=9Avue-router?= =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E9=BB=98=E8=AE=A4=E8=B7=B3=E8=BD=AC=20&=20?= =?UTF-8?q?=E6=8A=8Adist=E4=B8=8B=E7=9A=84router.js=E6=9A=B4=E9=9C=B2?= =?UTF-8?q?=E5=87=BA=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .npmignore | 1 + dist/router.js | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/.npmignore b/.npmignore index fec953c4a..d73d4ac34 100644 --- a/.npmignore +++ b/.npmignore @@ -36,6 +36,7 @@ !dist/font/**/* !dist/images/* !dist/images/**/* +!dist/router.js !babel.config.js !babel.config.ie8.js !.eslintrc \ No newline at end of file diff --git a/dist/router.js b/dist/router.js index 04c7b5408..c0e0469a6 100644 --- a/dist/router.js +++ b/dist/router.js @@ -3128,6 +3128,15 @@ this.$router = this._router = BI.Router.$router = $router = new VueRouter({ routes: this.options.routes }); + this.$router.beforeEach(function (to, from, next) { + if (to.matched.length === 0) { + //如果上级也未匹配到路由则跳转主页面,如果上级能匹配到则转上级路由 + from.path ? next({ path: from.path }) : next('/'); + } else { + //如果匹配到正确跳转 + next(); + } + }); this.$router.afterEach(function () { cbs.forEach(function (cb) {cb();}); }); From e3d9fc248e36e5c33b607df21f80a197955c233f Mon Sep 17 00:00:00 2001 From: Guyi Date: Mon, 23 Aug 2021 10:14:00 +0800 Subject: [PATCH 3/4] =?UTF-8?q?Revert=20"=E6=97=A0jira=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=EF=BC=8CfineuiWithoutJqueryAndPolyfillJs=E4=B8=AD=E5=8A=A0?= =?UTF-8?q?=E4=B8=8Ah.js"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3de2ffe3cc01c8f3e2e6c0b083f7f617e3746801. --- webpack/attachments.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/webpack/attachments.js b/webpack/attachments.js index 0515a809d..b141b9bf4 100644 --- a/webpack/attachments.js +++ b/webpack/attachments.js @@ -182,8 +182,7 @@ const fineuiIE = [].concat( const fineuiWithoutJqueryAndPolyfillJs = [].concat( sync([ - "src/core/0.foundation.js", - "src/core/h.js", + "src/core/foundation.js", lodashJs, "src/core/**/*.js", "src/data/**/*.js", From c04c937ea8b4b79e10b467afac09ed30e5355ce0 Mon Sep 17 00:00:00 2001 From: Guyi Date: Mon, 23 Aug 2021 10:24:10 +0800 Subject: [PATCH 4/4] =?UTF-8?q?KERNEL-8279=20refactor=EF=BC=9ARouterWidget?= =?UTF-8?q?=E6=94=B9=E6=88=90BI.RouterWidget?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/router.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/router.js b/dist/router.js index c0e0469a6..c1addf567 100644 --- a/dist/router.js +++ b/dist/router.js @@ -3123,7 +3123,7 @@ var $router, cbs = []; - var RouterWidget = BI.inherit(BI.Widget, { + BI.RouterWidget = BI.inherit(BI.Widget, { init: function () { this.$router = this._router = BI.Router.$router = $router = new VueRouter({ routes: this.options.routes @@ -3143,9 +3143,9 @@ this.$router.init(this); } }); - BI.shortcut("bi.router", RouterWidget); + BI.shortcut("bi.router", BI.RouterWidget); - var RouterView = BI.inherit(BI.Widget, { + BI.RouterView = BI.inherit(BI.Widget, { props: { deps: 0 }, @@ -3176,7 +3176,7 @@ BI.remove(cbs, this._callbackListener); } }); - BI.shortcut("bi.router_view", RouterView); + BI.shortcut("bi.router_view", BI.RouterView); BI.Router = BI.Router || VueRouter; BI.Router.isSameRoute = isSameRoute;