Commit e05b7274 authored by yanglilong's avatar yanglilong

'修复顶部菜单tag'

parent bee7d3b8
...@@ -32,8 +32,8 @@ export default { ...@@ -32,8 +32,8 @@ export default {
created() {}, created() {},
mounted() {}, mounted() {},
methods: { methods: {
clickEvent() { clickEvent(e) {
this.$emit("click"); this.$emit("click", e);
}, },
}, },
}; };
......
...@@ -44,6 +44,7 @@ export default { ...@@ -44,6 +44,7 @@ export default {
loginOut() { loginOut() {
this.$apis.LOGINOUT().then((res) => { this.$apis.LOGINOUT().then((res) => {
if (res.returnCode) { if (res.returnCode) {
this.$store.commit("common/setMenuStack", []);
this.$router.push("/login"); this.$router.push("/login");
} else { } else {
this.$message.error(res.returnMsg || "退出失败"); this.$message.error(res.returnMsg || "退出失败");
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
:to="item.path" :to="item.path"
> >
{{ item.title }} {{ item.title }}
<Icon <Icon v-if="menuStack.length>1"
@click="closeMenu(index)" @click="(e)=>closeMenu(e, index)"
:name="isVisit(item.path) ? 'ssiclose_active' : 'ssiclose'" :name="isVisit(item.path) ? 'ssiclose_active' : 'ssiclose'"
:size="16" :size="16"
/> />
...@@ -31,7 +31,8 @@ export default { ...@@ -31,7 +31,8 @@ export default {
const path = this.$route.path; const path = this.$route.path;
return path === val; return path === val;
}, },
closeMenu(index) { closeMenu(e, index) {
e.stopPropagation();
const menuStack = JSON.parse(JSON.stringify(this.menuStack)); const menuStack = JSON.parse(JSON.stringify(this.menuStack));
const isVisit = this.isVisit(menuStack[index].path); const isVisit = this.isVisit(menuStack[index].path);
menuStack.splice(index, 1); menuStack.splice(index, 1);
......
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