Commit edb1616b by 无尘

fix: 删除打印

parent f343ba10
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "@gic-test/vue-office-aside", "name": "@gic-test/vue-office-aside",
"description": "vue-office-aside Plugin", "description": "vue-office-aside Plugin",
"author": "fairyly <498745097@qq.com>", "author": "fairyly <498745097@qq.com>",
"version": "1.0.26", "version": "1.0.31",
"license": "MIT", "license": "MIT",
"private": false, "private": false,
"main": "dist/vue-office-aside.js", "main": "dist/vue-office-aside.js",
......
...@@ -64,9 +64,8 @@ ...@@ -64,9 +64,8 @@
}, },
handleSelect(key, keyPath){ handleSelect(key, keyPath){
const that = this const that = this;
console.log(key, keyPath); that.selectMenu = key;
that.selectMenu = key
}, },
// 设置新数据 // 设置新数据
...@@ -98,12 +97,19 @@ ...@@ -98,12 +97,19 @@
const that = this; const that = this;
data.forEach(function(ele,index){ data.forEach(function(ele,index){
if (('/' + that.pathName) == ele.url) { if (('/' + that.pathName) == ele.url) {
that.selectMenu = '/' + that.pathName that.selectMenu = '/' + that.pathName;
}else { }else {
ele.children.forEach(function(el,key){ ele.children.forEach(function(el,key){
if (('/' + that.pathName) == el.url) { if (('/' + that.pathName) == el.url) {
that.selectMenu = !!el.display? el.url : ele.url; that.selectMenu = !!el.display? el.url : ele.url;
} }
if (!!el.children.length) {
el.children.forEach(function(item,k){
if (item.url == that.pathName) {
that.selectMenu = el.url;
}
})
}
}) })
} }
}) })
...@@ -117,17 +123,17 @@ ...@@ -117,17 +123,17 @@
// 刷新路由 // 刷新路由
refreshRoute() { refreshRoute() {
const that = this const that = this;
//获取项目名 pathname (路由的hash) //获取项目名 pathname (路由的hash)
that.routePathName = window.location.hash.split('/')[1]; that.routePathName = window.location.hash.split('/')[1];
if (that.routePathName.indexOf('?')!= -1) { if (that.routePathName.indexOf('?')!= -1) {
that.routePathName = that.routePathName.split('?')[0] that.routePathName = that.routePathName.split('?')[0];
} }
if (that.routePathName.indexOf('/')!= -1) { if (that.routePathName.indexOf('/')!= -1) {
that.routePathName = that.routePathName.split('/')[0] that.routePathName = that.routePathName.split('/')[0];
} }
that.pathName = that.routePathName that.pathName = that.routePathName;
that.getLeftMenu() that.getLeftMenu();
}, },
/** /**
...@@ -141,12 +147,12 @@ ...@@ -141,12 +147,12 @@
if(branchArr.length>0){ if(branchArr.length>0){
father.children = branchArr; //如果存在子级,则给父级添加一个children属性,并赋值 father.children = branchArr; //如果存在子级,则给父级添加一个children属性,并赋值
}else { }else {
father.children = [] father.children = [];
} }
return father.level == 1; //返回第一层 return father.level == 1; //返回第一层
}); });
tree.sort(function(a,b){ tree.sort(function(a,b){
return a.sort - b.sort return a.sort - b.sort;
}); });
return tree; return tree;
}, },
...@@ -172,7 +178,7 @@ ...@@ -172,7 +178,7 @@
}) })
return; return;
} }
that.setNewData(that.treeData(resData.result.leftMenu)) that.setNewData(that.treeData(resData.result.leftMenu));
return; return;
} }
that.$message.error({ that.$message.error({
...@@ -217,7 +223,7 @@ ...@@ -217,7 +223,7 @@
//获取项目名 pathname (路由的hash) //获取项目名 pathname (路由的hash)
that.pathName = window.location.hash.split('/')[1]; that.pathName = window.location.hash.split('/')[1];
if (that.pathName.indexOf('?')!= -1) { if (that.pathName.indexOf('?')!= -1) {
that.pathName = that.pathName.split('?')[0] that.pathName = that.pathName.split('?')[0];
} }
// 获取菜单 // 获取菜单
that.getLeftMenu(); that.getLeftMenu();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment