feat: initialize Vue component library and aligned documentation
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
import { inject } from "vue";
|
||||
import { switchKey } from "./context";
|
||||
const ctx = inject(switchKey);
|
||||
if (!ctx) throw new Error("SwitchControl must be inside Switch");
|
||||
</script>
|
||||
<template>
|
||||
<span class="hv-switch__control" data-slot="switch-control">
|
||||
<slot
|
||||
:is-selected="ctx.checked.value"
|
||||
:is-hovered="ctx.hovered.value"
|
||||
:is-pressed="ctx.pressed.value"
|
||||
:is-focus-visible="ctx.focusVisible.value"
|
||||
/>
|
||||
</span>
|
||||
</template>
|
||||
Reference in New Issue
Block a user