32 lines
679 B
Vue
32 lines
679 B
Vue
<script setup lang="ts">
|
|
import {
|
|
Label,
|
|
Meter,
|
|
MeterFill,
|
|
MeterOutput,
|
|
MeterTrack,
|
|
} from "@heroui-vue/components";
|
|
|
|
const colors = ["default", "accent", "success", "warning", "danger"] as const;
|
|
|
|
const colorLabels: Record<(typeof colors)[number], string> = {
|
|
accent: "强调",
|
|
danger: "危险",
|
|
default: "默认",
|
|
success: "成功",
|
|
warning: "警告",
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<div class="flex w-64 flex-col gap-6">
|
|
<Meter v-for="color in colors" :key="color" :color="color" :value="50">
|
|
<Label>{{ colorLabels[color] }}</Label>
|
|
<MeterOutput />
|
|
<MeterTrack>
|
|
<MeterFill />
|
|
</MeterTrack>
|
|
</Meter>
|
|
</div>
|
|
</template>
|