mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-29 02:49:13 -04:00
feat(ui-lib): demo pages for c-lib components
This commit is contained in:
parent
e88c1d5f2c
commit
92bd83536f
14 changed files with 294 additions and 248 deletions
12
src/ui/c-link/c-link.demo.vue
Normal file
12
src/ui/c-link/c-link.demo.vue
Normal 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>
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue