|
|
|
@ -31,7 +31,8 @@
|
|
|
|
|
let _this = this;
|
|
|
|
|
document.addEventListener('click', function (e) {
|
|
|
|
|
let menuDiv = document.getElementById("navigationMenuId");
|
|
|
|
|
if (!e.path.includes(menuDiv)) {
|
|
|
|
|
let path = _this.composedPath(e);
|
|
|
|
|
if (!path.includes(menuDiv)) {
|
|
|
|
|
if (_this.$refs.navigationMenu) {
|
|
|
|
|
_this.$refs.navigationMenu.hiddenMenuFlag();
|
|
|
|
|
}
|
|
|
|
@ -72,6 +73,20 @@
|
|
|
|
|
},
|
|
|
|
|
modelChange: function (path) {
|
|
|
|
|
this.$router.replace({path: path});
|
|
|
|
|
},
|
|
|
|
|
composedPath:function (e) {
|
|
|
|
|
// 存在则直接return
|
|
|
|
|
if (e.path) { return e.path }
|
|
|
|
|
// 不存在则遍历target节点
|
|
|
|
|
let target = e.target
|
|
|
|
|
e.path = []
|
|
|
|
|
while (target.parentNode !== null) {
|
|
|
|
|
e.path.push(target)
|
|
|
|
|
target = target.parentNode
|
|
|
|
|
}
|
|
|
|
|
// 最后补上document和window
|
|
|
|
|
e.path.push(document, window)
|
|
|
|
|
return e.path
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
components: {
|
|
|
|
|