Commit fba44059 authored by 仇晓婷's avatar 仇晓婷

收藏

parent 479160cf
...@@ -139,7 +139,7 @@ export default { ...@@ -139,7 +139,7 @@ export default {
oldScrollTop: 0, oldScrollTop: 0,
isDelayHideSider: false, // hack,当从隐藏侧边栏的 header 切换到正常 header 时,防止 Logo 抖动 isDelayHideSider: false, // hack,当从隐藏侧边栏的 header 切换到正常 header 时,防止 Logo 抖动
loadRouter: true, loadRouter: true,
showStar: true, showStar: null,
content: "收藏", content: "收藏",
menuId: null, menuId: null,
homeMenu: "", homeMenu: "",
...@@ -253,6 +253,7 @@ export default { ...@@ -253,6 +253,7 @@ export default {
}, 0); }, 0);
}, },
$route(to, from) { $route(to, from) {
// alert(to.path)
if (to.name === from.name) { if (to.name === from.name) {
// 相同路由,不同参数,跳转时,重载页面 // 相同路由,不同参数,跳转时,重载页面
if (Setting.sameRouteForceUpdate) { if (Setting.sameRouteForceUpdate) {
...@@ -262,17 +263,21 @@ export default { ...@@ -262,17 +263,21 @@ export default {
console.warn("to-from", to, from, this.filterSider); console.warn("to-from", to, from, this.filterSider);
//获取收藏列表,判断的当前路由是否收藏 //获取收藏列表,判断的当前路由是否收藏
let star = false; let star = false;
// console.warn("to-from======", this.$store.state.collect);
this.$store.state.collect.map((u) => { this.$store.state.collect.map((u) => {
if (u.path == from.path) { if (u.url == to.path) {
star = true; star = true;
} else {
star = false;
} }
}); });
this.showStar = star; this.showStar = star;
// alert(this.showStar);
//获取菜单path并与当前路由比对,获取当前菜单id //获取菜单path并与当前路由比对,获取当前菜单id
let dataTemp = this.$u.treeToList(this.filterSider); let dataTemp = this.$u.treeToList(this.filterSider);
dataTemp.forEach((data) => { dataTemp.forEach((data) => {
if (data.path == from.path) { if (data.path == to.path) {
this.menuId = data.id; this.menuId = data.id;
} }
}); });
......
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