navigation permission and ability checker
This commit is contained in:
parent
cb80771f7a
commit
35cba95887
6 changed files with 213 additions and 92 deletions
|
@ -28,6 +28,7 @@ import { useNavigationStore } from "@/stores/admin/navigation";
|
|||
import SidebarLayout from "@/layouts/Sidebar.vue";
|
||||
import SidebarTemplate from "@/templates/Sidebar.vue";
|
||||
import RoutingLink from "@/components/admin/RoutingLink.vue";
|
||||
import { useAbilityStore } from "../../stores/ability";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
@ -57,13 +58,26 @@ export default defineComponent({
|
|||
},
|
||||
},
|
||||
created() {
|
||||
useAbilityStore().$subscribe(() => {
|
||||
this.updateTopLevel();
|
||||
this.updateNavigation();
|
||||
});
|
||||
this.updateTopLevel();
|
||||
this.updateNavigation();
|
||||
|
||||
this.setLink(this.activeTopLevelObject.levelDefault);
|
||||
},
|
||||
beforeUnmount() {
|
||||
this.resetNavigation();
|
||||
},
|
||||
methods: {
|
||||
...mapActions(useNavigationStore, ["setLink", "resetNavigation", "setTopLevel"]),
|
||||
...mapActions(useNavigationStore, [
|
||||
"setLink",
|
||||
"resetNavigation",
|
||||
"setTopLevel",
|
||||
"updateTopLevel",
|
||||
"updateNavigation",
|
||||
]),
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue