-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: refactor scroll bar and basic layout
- Loading branch information
1 parent
713697b
commit 91317d2
Showing
11 changed files
with
114 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,35 @@ | ||
<script setup lang="ts"> | ||
import { type VNodeRef, ref } from 'vue'; | ||
import { getPlatform } from '~/platforms'; | ||
import H1 from '~/components/typo/H1.vue'; | ||
import QScrollbar from '~/components/QScrollbar.vue'; | ||
defineProps<{ customPadding?: boolean }>(); | ||
defineProps<{ header: string; showModel?: boolean }>(); | ||
const scrollbar = ref<VNodeRef | null>(null); | ||
const pt = getPlatform() !== 'web' ? 'pt-12' : 'pt-4'; | ||
defineExpose({ | ||
scrollbar, | ||
}); | ||
</script> | ||
|
||
<template> | ||
<main | ||
:class="`relative h-full w-full grow ${getPlatform() !== 'web' ? 'pt-12' : 'pt-4'} pb-1 ${customPadding ? 'px-1' : 'px-3 sm:px-16'} overflow-auto flex flex-col`" | ||
class="relative h-full w-full grow pb-1 overflow-auto flex flex-col px-1" | ||
:class="pt" | ||
> | ||
<slot /> | ||
<div class="flex justify-between px-16"> | ||
<H1>{{ header }}</H1> | ||
<slot name="header-extra" /> | ||
</div> | ||
<div class="px-16"> | ||
<slot name="actions" /> | ||
</div> | ||
<QScrollbar ref="scrollbar" class="flex-1 grow relative px-16"> | ||
<slot /> | ||
</QScrollbar> | ||
<div v-if="showModel" class="absolute inset-0 bg-[#4b4b4b80] flex justify-center items-center" :class="pt"> | ||
<slot name="model" /> | ||
</div> | ||
</main> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.