Update menu by login permission
This commit is contained in:
parent
a43aafddd1
commit
020ee95f96
@ -7,7 +7,7 @@
|
||||
<div class="menu-container">
|
||||
<dx-tree-view
|
||||
ref="treeViewRef"
|
||||
:items="items"
|
||||
:items="menus"
|
||||
key-expr="path"
|
||||
selection-mode="single"
|
||||
:focus-state-enabled="false"
|
||||
@ -25,6 +25,7 @@ import { sizes } from '../utils/media-query';
|
||||
import navigation from '../app-navigation';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import auth from "../auth";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@ -34,6 +35,11 @@ export default {
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const menus = ref("");
|
||||
auth.getUser().then((e) => menus.value = e.data.menus);
|
||||
//console.log(navigation);
|
||||
console.log(menus);
|
||||
|
||||
const isLargeScreen = sizes()['screen-large'];
|
||||
const items = navigation.map((item) => {
|
||||
if(item.path && !(/^\//.test(item.path))){
|
||||
@ -98,7 +104,8 @@ export default {
|
||||
items,
|
||||
forwardClick,
|
||||
handleItemClick,
|
||||
updateSelection
|
||||
updateSelection,
|
||||
menus
|
||||
};
|
||||
},
|
||||
components: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user