chore(Skeleton): new component

This commit is contained in:
Benjamin Canac
2023-05-14 17:05:38 +02:00
parent 6fd5a70ac9
commit 8caa78819a
4 changed files with 84 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<template>
<div :class="[ui.base, ui.background, ui.rounded]" />
</template>
<script lang="ts">
import { computed, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { defu } from 'defu'
import { useAppConfig } from '#imports'
// TODO: Remove
// @ts-expect-error
import appConfig from '#build/app.config'
// const appConfig = useAppConfig()
export default defineComponent({
props: {
ui: {
type: Object as PropType<Partial<typeof appConfig.ui.skeleton>>,
default: () => appConfig.ui.skeleton
}
},
setup (props) {
// TODO: Remove
const appConfig = useAppConfig()
const ui = computed<Partial<typeof appConfig.ui.skeleton>>(() => defu({}, props.ui, appConfig.ui.skeleton))
return {
// eslint-disable-next-line vue/no-dupe-keys
ui
}
}
})
</script>