Commit 445c4639 authored by 水落(YangLei)'s avatar 水落(YangLei)

bugfix: 优化代码

parent c9eb73e3
......@@ -66,9 +66,7 @@ export default {
},
setHtmlTitle() {
const route = this.$route;
const key =
route.path === '/' ? 'home.name' : getI18nKey(route.matched[route.matched.length - 1].path);
document.title = process.env.VUE_APP_NAME + ' | ' + this.$t(key);
if (route.name) window.title = route.name;
},
popContainer() {
return document.getElementById('popContainer');
......
......@@ -186,6 +186,7 @@ export default {
getOpenKeysByPath(path) {
const { menuList } = getUserInfo();
const { parentMenuId } = this.menuData.find(m => m.menuUrl === path);
if (parentMenuId === 0) return [];
const parentMenus = [parentMenuId];
const res = [parentMenuId];
while (parentMenus.length) {
......
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