create dashboard layout

This commit is contained in:
Geriano
2022-07-16 04:29:30 +07:00
parent 2ca55419f7
commit cff8ab1b72
11 changed files with 276 additions and 16 deletions

View File

@@ -0,0 +1,23 @@
<script setup>
import { getCurrentInstance } from 'vue'
import { Link } from '@inertiajs/inertia-vue3'
import Icon from '@/Components/Icon.vue'
const { menu } = defineProps({
menu: Object,
})
const active = route().current(menu.route_or_url)
if (route().has(menu.route_or_url))
menu.route_or_url = route(menu.route_or_url)
</script>
<template>
<Link :href="menu.route_or_url" class="w-full px-4 py-3" :class="`${themes().get('sidebar', 'bg-slate-700 text-gray-200')} ${active && 'bg-slate-800'}`">
<div class="flex items-center space-x-2">
<Icon :name="menu.icon" />
<p class="uppercase font-semibold">{{ menu.name }}</p>
</div>
</Link>
</template>