Skip to content

Commit

Permalink
fix: vue修复menu管理删除menu时tabs未更新问题 (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
Muyu-art authored Sep 2, 2024
1 parent ab6b340 commit 2238134
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import { useDeepClone } from '@/hooks/useDeepClone';
import { useMenuStore } from '@/store/modules/router';
import { useRouter } from 'vue-router';
import { useTabStore } from '@/store';
import menuTree, { Node } from './menu-tree.vue';
import UpdateForm from './update-form.vue';
import AddMenu from './add-menu.vue';
Expand Down Expand Up @@ -45,6 +46,7 @@
const { loading: addLoading, setLoading: setAddLoading } = useLoading();
const addModal = ref(false);
const router = useRouter();
const tabStore = useTabStore();
const handleAddMenu = () => {
addModal.value = true;
Expand Down Expand Up @@ -109,7 +111,10 @@
});
return fetchMenu();
})
.then(() => updateUserMenu())
.then(() => {
updateUserMenu();
tabStore.delByLink(`/vue-pro/${node.url}`);
})
.catch((reason) => {
const error = reason;
if (error.response && error.response.data) {
Expand Down

0 comments on commit 2238134

Please sign in to comment.