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

bugfix: 优化代码

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