From 20bd8bfed51593c5ebe4aa839b09a4df4cb87836 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 20 Aug 2021 23:57:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/router.js | 66 ++++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/dist/router.js b/dist/router.js index 619b6c0e5..176350913 100644 --- a/dist/router.js +++ b/dist/router.js @@ -1242,39 +1242,39 @@ // } // }; - // function guardEvent (e) { - // // don't redirect with control keys - // if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { return } - // // don't redirect when preventDefault called - // if (e.defaultPrevented) { return } - // // don't redirect on right click - // if (e.button !== undefined && e.button !== 0) { return } - // // don't redirect if `target="_blank"` - // if (e.currentTarget && e.currentTarget.getAttribute) { - // var target = e.currentTarget.getAttribute('target'); - // if (/\b_blank\b/i.test(target)) { return } - // } - // // this may be a Weex event which doesn't have this method - // if (e.preventDefault) { - // e.preventDefault(); - // } - // return true - // } + function guardEvent (e) { + // don't redirect with control keys + if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { return } + // don't redirect when preventDefault called + if (e.defaultPrevented) { return } + // don't redirect on right click + if (e.button !== undefined && e.button !== 0) { return } + // don't redirect if `target="_blank"` + if (e.currentTarget && e.currentTarget.getAttribute) { + var target = e.currentTarget.getAttribute('target'); + if (/\b_blank\b/i.test(target)) { return } + } + // this may be a Weex event which doesn't have this method + if (e.preventDefault) { + e.preventDefault(); + } + return true + } - // function findAnchor (children) { - // if (children) { - // var child; - // for (var i = 0; i < children.length; i++) { - // child = children[i]; - // if (child.tag === 'a') { - // return child - // } - // if (child.children && (child = findAnchor(child.children))) { - // return child - // } - // } - // } - // } + function findAnchor (children) { + if (children) { + var child; + for (var i = 0; i < children.length; i++) { + child = children[i]; + if (child.tag === 'a') { + return child + } + if (child.children && (child = findAnchor(child.children))) { + return child + } + } + } + } // var _Vue; @@ -3169,6 +3169,8 @@ }); BI.shortcut("bi.router_view", RouterView); + BI.Router = VueRouter; + BI.Router.isSameRoute = isSameRoute; return VueRouter; })));