I am trying to display navigation items based on my authority and other conditions. Below is the code I am using:
<template v-for="(subItem, index2) in item.children">
<v-list-item sub-group link :to="subItem.link" exact v-if="item.auth === true" :key="index + '_sub_' + index2">
<v-list-item-title v-text="subItem.title" ></v-list-item-title>
</v-list-item>
</template>
I want to disable click when v-if="item.auth === true
Below is my object structure:
children: [
{name:'menu1', title:'menu1', link:'/company/menu1', auth: () => {return this.currentNav===0 }}, // not working
{name:'menu2', title:'menu2', link:'/company/menu2', auth: true}, // works
{name:'menu3', title:'menu3', link:'/company/menu3', auth: this.MyInfo.Auth.menu3Auth === true }, // works, but menu visibility does not change when MyInfo.Auth.menu3Auth value changes.
{name:'menu4', title:'menu4', link:'/company/menu4', auth: () => {return this.currentNav===4 || this.MyInfo.Auth.menu3Auth === true }},
{name:'menu5', title:'menu5', link:'/company/menu5', auth: () => {return this.MyInfo.Auth.menu5Auth === false && this.MyInfo.Auth.menu3Auth === true }
}
However, it is not functioning as expected. How can I resolve this issue?