feat(ui-lib): demo pages for c-lib components

This commit is contained in:
Corentin Thomasset 2023-04-23 22:26:32 +02:00 committed by Corentin THOMASSET
parent e88c1d5f2c
commit 92bd83536f
14 changed files with 294 additions and 248 deletions

View file

@ -0,0 +1,12 @@
<template>
<div>
<h2>Default</h2>
<c-link mx-1> Link </c-link>
</div>
</template>
<script lang="ts" setup>
import CLink from './c-link.vue';
</script>
<style lang="less" scoped></style>

View file

@ -16,7 +16,15 @@ const props = defineProps<{
const { href, to } = toRefs(props);
const theme = useTheme();
const tag = computed(() => (href?.value ? 'a' : RouterLink));
const tag = computed(() => {
if (href?.value) {
return 'a';
}
if (to?.value) {
return RouterLink;
}
return 'span';
});
</script>
<style lang="less" scoped>