guy 3 years ago
parent
commit
20bd8bfed5
  1. 66
      dist/router.js

66
dist/router.js vendored

@ -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;
})));

Loading…
Cancel
Save