组件
提醒 Alert
警告提示:嵌在页面中的通知。背景使用状态色的浅色填充,前缘有一条更重的发丝线,标题使用衬线字。
#基础用法
Renewal scheduled
The archive will be reindexed tonight.
Sealed and delivered
Your petition reached the desk.
Stamp expiring
The permit lapses in seven days.
Delivery refused
The address could not be verified.
<script setup lang="ts">
import { Alert } from "@bysages/vue";
const notices = [
{
status: "info",
title: "Renewal scheduled",
description: "The archive will be reindexed tonight.",
},
{
status: "success",
title: "Sealed and delivered",
description: "Your petition reached the desk.",
},
{ status: "warning", title: "Stamp expiring", description: "The permit lapses in seven days." },
{
status: "danger",
title: "Delivery refused",
description: "The address could not be verified.",
},
];
</script>
<template>
<div class="grid gap-4">
<Alert.Root v-for="n in notices" :key="n.status" :status="n.status" class="w-120">
<Alert.Icon />
<Alert.Body>
<Alert.Title>{{ n.title }}</Alert.Title>
<Alert.Description>{{ n.description }}</Alert.Description>
</Alert.Body>
</Alert.Root>
</div>
</template>
#属性
#AlertRoot
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
status | String | "ink" | — |
#AlertIcon
纯造型的部件——自身没有属性,沿用部件结构的共享样式。
#AlertBody
纯造型的部件——自身没有属性,沿用部件结构的共享样式。
#AlertTitle
纯造型的部件——自身没有属性,沿用部件结构的共享样式。
#AlertDescription
纯造型的部件——自身没有属性,沿用部件结构的共享样式。