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,30 @@
<script setup>
import { getCurrentInstance, ref } from 'vue'
import axios from 'axios'
import { usePage } from '@inertiajs/inertia-vue3'
import Builder from './Sidebar/Builder.vue'
import Icon from '@/Components/Icon.vue'
const self = getCurrentInstance()
const menus = ref([])
const { user } = usePage().props.value
const fetch = async () => {
try {
const response = await axios.get(route('api.v1.user.menu', user.id))
return menus.value = response.data
} catch (e) {
setTimeout(fetch, 1000)
}
}
fetch()
</script>
<template>
<div class="flex flex-col w-full h-full bg-inherit">
<Builder v-if="menus.length" :menus="menus" />
</div>
<div class="hidden pl-8"></div>
</template>