feat: initialize Vue component library and aligned documentation

This commit is contained in:
maoyingjie
2026-10-21 09:06:28 +08:00
commit 9d40dc0ecb
149 changed files with 13208 additions and 0 deletions
@@ -0,0 +1,25 @@
<script setup lang="ts">
import { inject, useAttrs } from "vue";
import { switchKey } from "../switch/context";
const ctx = inject(switchKey, undefined);
const attrs = useAttrs();
defineProps<{
isRequired?: boolean;
isDisabled?: boolean;
isInvalid?: boolean;
}>();
</script>
<template>
<component
:is="ctx && !attrs.for ? 'span' : 'label'"
class="hv-label"
:class="{
'hv-label--required': isRequired,
'hv-label--disabled': isDisabled,
'hv-label--invalid': isInvalid,
}"
data-slot="label"
>
<slot />
</component>
</template>