tambah menu sideBarMenu , middleware definepagemeta
This commit is contained in:
@@ -1,16 +1,28 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import UiParentCard from "@/components/shared/UiParentCard.vue";
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useHakAksesStore } from '@/stores/sidebarMenuAkses/useMenuAksesStore'
|
||||
|
||||
const route = useRoute()
|
||||
const aksesMenu = useHakAksesStore();
|
||||
|
||||
console.log('masuk pages', route.meta ,aksesMenu.permissionPage);
|
||||
|
||||
//const permission = ["view"];
|
||||
|
||||
definePageMeta({
|
||||
middleware: ["auth-menu"],
|
||||
role: ['admin','staff'],
|
||||
//permission: [permission],
|
||||
});
|
||||
|
||||
const permissions = route.meta || []
|
||||
</script>
|
||||
<template>
|
||||
<v-row>
|
||||
<v-col cols="12" md="12">
|
||||
<v-card elevation="10">
|
||||
<v-card-item>
|
||||
<h5 class="text-h5 mb-3">Sample Page Copy</h5>
|
||||
<h5 class="text-h5 mb-3">Sample Page Copy {{ permissions }}</h5>
|
||||
<p class="text-body-1">This is a sample page</p>
|
||||
</v-card-item>
|
||||
</v-card>
|
||||
|
||||
19
pages/Sample-Page-login.vue
Normal file
19
pages/Sample-Page-login.vue
Normal file
@@ -0,0 +1,19 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import UiParentCard from "@/components/shared/UiParentCard.vue";
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<v-row>
|
||||
<v-col cols="12" md="12">
|
||||
<v-card elevation="10">
|
||||
<v-card-item>
|
||||
<h5 class="text-h5 mb-3">Sample Page Copy</h5>
|
||||
<p class="text-body-1">This is a sample page</p>
|
||||
</v-card-item>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
@@ -1,30 +1,32 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import UiParentCard from "@/components/shared/UiParentCard.vue";
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useHakAksesStore } from '@/stores/sidebarMenuAkses/useMenuAksesStore'
|
||||
|
||||
const route = useRoute()
|
||||
const aksesMenu = useHakAksesStore();
|
||||
|
||||
console.log('masuk pages', route.meta ,aksesMenu.permissionPage);
|
||||
|
||||
//const permission = ["view"];
|
||||
|
||||
definePageMeta({
|
||||
middleware: ["auth-menu"],
|
||||
//middleware : ['sidebase-auth']
|
||||
role: ['superadmin','admin'],
|
||||
//permission: [permission],
|
||||
});
|
||||
|
||||
const { status, data: session } = useAuth();
|
||||
if (status.value === "unauthenticated") {
|
||||
console.log("status", status.value);
|
||||
} else {
|
||||
console.log("status", status.value);
|
||||
}
|
||||
|
||||
|
||||
const permissions = route.meta || []
|
||||
</script>
|
||||
<template>
|
||||
<v-row>
|
||||
<v-col cols="12" md="12">
|
||||
<v-card elevation="10">
|
||||
<v-card-item>
|
||||
<h5 class="text-h5 mb-3">Sample Page</h5>
|
||||
<h5 class="text-h5 mb-3">Sample Page {{ permissions }}</h5>
|
||||
<p class="text-body-1">This is a sample page</p>
|
||||
</v-card-item>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
/*-For Set Blank Layout-*/
|
||||
definePageMeta({
|
||||
layout: "blank",
|
||||
middleware: ["auth-menu"],
|
||||
//role: ['admin'],
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user