apkt-eis/src/components/Pages/MenuProvider.vue
2023-10-27 09:38:20 +07:00

21 lines
707 B
Vue

<template>
<main class="flex-1 px-4 overflow-y-auto bg-white md:mr-3 sm:px-3 md:px-6 rounded-t-2xl md:rounded-t-3xl no-scroll-bar">
<div v-if="route.path !== '/home'" class="mt-4 lg:mt-6 max-w-7xl">
<h1 class="text-xl font-medium md:text-3xl text-dark">{{ currentRouteName }}</h1>
</div>
<div class="mt-2 sm:mt-4 dx-viewport">
<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>