sidebar work in progress
This commit is contained in:
29
web/components/ui/Sidebar.vue
Normal file
29
web/components/ui/Sidebar.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<script setup lang="ts">
|
||||
import { CalendarDate } from '@internationalized/date';
|
||||
import Title1 from './Title1.vue';
|
||||
import { UCard } from '#components';
|
||||
|
||||
const selectedDate = shallowRef(new CalendarDate(2024, 6, 29));
|
||||
|
||||
defineProps<{
|
||||
todos: string[]
|
||||
}>()
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UCard class="w-64 h-full">
|
||||
<template #header>
|
||||
<Title1>Calendar</Title1>
|
||||
<UCalendar v-model="selectedDate" />
|
||||
</template>
|
||||
<template #default>
|
||||
<Title1>Todos</Title1>
|
||||
<div class="flex gap-2 flex-col">
|
||||
<UCard v-for="todo in todos">{{ todo }}</UCard>
|
||||
</div>
|
||||
</template>
|
||||
</UCard>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
11
web/components/ui/Title1.vue
Normal file
11
web/components/ui/Title1.vue
Normal file
@@ -0,0 +1,11 @@
|
||||
<template>
|
||||
<h1 class="text-xl font-bold">
|
||||
<slot />
|
||||
</h1>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -1,12 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import { UButton } from '#components';
|
||||
import Sidebar from '~/components/ui/Sidebar.vue';
|
||||
|
||||
const todos = ["Staistics", "Computer Graphics", "Webdev"]
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<UButton>Click me</UButton>
|
||||
<div class="h-screen w-screen p-4">
|
||||
<Sidebar :todos="todos" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user