feat: migrate ColorSwatch and public color boundary

This commit is contained in:
maoyingjie
2026-10-26 13:25:21 +08:00
parent 60af6ee40b
commit 270dea5cff
29 changed files with 1427 additions and 18 deletions
@@ -0,0 +1,25 @@
<script setup lang="ts">
import { ColorSwatch } from "@heroui-vue/components";
const colors = [
{ color: "#0485F7", label: "蓝色", name: "blue" },
{ color: "#EF4444", label: "红色", name: "red" },
{ color: "#F59E0B", label: "琥珀色", name: "amber" },
{ color: "#10B981", label: "绿色", name: "green" },
{ color: "#D946EF", label: "品红", name: "fuchsia" },
];
</script>
<template>
<div class="flex items-center gap-3">
<ColorSwatch
v-for="item in colors"
:key="item.color"
:color="item.color"
:aria-label="item.label"
as-child
>
<div :data-custom="item.name" />
</ColorSwatch>
</div>
</template>