apkt-eis/src/components/Menus/MenuProvider.vue
Dede Fuji Abdul fc37eab5db update
2023-10-17 09:20:08 +07:00

22 lines
714 B
Vue

<template>
<main
class="flex-1 px-2 py-2 overflow-y-auto bg-white md:mr-4 sm:px-4 md:px-6 sm:py-4 md:py-6 rounded-t-3xl no-scroll-bar">
<div v-if="route.path !== '/home'" class="mx-auto max-w-7xl">
<h1 class="text-lg font-medium md:text-2xl lg:text-3xl text-dark">{{ currentRouteName }}</h1>
</div>
<div class="my-2 sm:my-4">
<slot></slot>
</div>
</main>
</template>
<script setup lang="ts">
import { computed } from 'vue'
import { useRoute } from 'vue-router'
// Dapatkan objek route dari vue-router
const route = useRoute()
// Dapatkan nama rute menggunakan computed property
const currentRouteName = computed(() => route.name)
</script>