feat: disabled menu

This commit is contained in:
Methapon2001 2024-07-01 11:14:01 +07:00
parent 8cb6a87be1
commit 17bf0737eb
3 changed files with 51 additions and 8 deletions

View file

@ -7,7 +7,9 @@ const router = useRouter();
const currentRoute = ref<string>('');
const labelMenu = ref<{ label: string; icon: string; route: string }[]>([
const labelMenu = ref<
{ label: string; icon: string; route: string; disabled?: boolean }[]
>([
{
label: 'drawerDashboard',
icon: 'img:/file-account-outline.png',
@ -33,16 +35,43 @@ const labelMenu = ref<{ label: string; icon: string; route: string }[]>([
icon: 'raphael:package',
route: '/product-service',
},
{ label: 'drawerQuotation', icon: 'raphael:package', route: '' },
{ label: 'drawerRequestList', icon: 'raphael:package', route: '' },
{ label: 'drawerWorkOrder', icon: 'raphael:package', route: '' },
{ label: 'drawerInvoice', icon: 'raphael:package', route: '' },
{
label: 'drawerQuotation',
icon: 'raphael:package',
route: '',
disabled: true,
},
{
label: 'drawerRequestList',
icon: 'raphael:package',
route: '',
disabled: true,
},
{
label: 'drawerWorkOrder',
icon: 'raphael:package',
route: '',
disabled: true,
},
{
label: 'drawerInvoice',
icon: 'raphael:package',
route: '',
disabled: true,
},
{
label: 'drawerAccountingLedger',
icon: 'mdi-account-cash-outline',
route: '',
disabled: true,
},
{
label: 'drawerReport',
icon: 'mdi-file-chart-outline',
route: '',
disabled: true,
},
{ label: 'drawerReport', icon: 'mdi-file-chart-outline', route: '' },
]);
const leftDrawerOpen = defineModel<boolean>('leftDrawerOpen', {
@ -83,6 +112,7 @@ function navigateTo(label: string, destination: string) {
v-for="v in labelMenu"
:key="v.label"
clickable
:disable="!!v.disabled"
@click="navigateTo(v.label, v.route)"
class="no-padding"
:class="{ active: currentRoute === v.label, dark: $q.dark.isActive }"