update component structure

This commit is contained in:
Dede Fuji Abdul
2023-10-19 09:32:47 +07:00
parent 3a29562969
commit 21fc2789ac
17 changed files with 64 additions and 360 deletions

View File

@ -0,0 +1,22 @@
<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>