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,17 @@
<script setup lang="ts">
import { inject, onBeforeUnmount, useId, useAttrs } from "vue";
import { switchKey } from "../switch/context";
const ctx = inject(switchKey, undefined);
const attrs = useAttrs();
const id = String(attrs.id ?? useId());
if (ctx) ctx.descriptionIds.value = [...ctx.descriptionIds.value, id];
onBeforeUnmount(() => {
if (ctx)
ctx.descriptionIds.value = ctx.descriptionIds.value.filter(
(value) => value !== id,
);
});
</script>
<template>
<p :id="id" class="hv-description" data-slot="description"><slot /></p>
</template>