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