Skip to content

Alert 警告

用于页面中展示重要的提示信息。

基础用法

成功提示
消息提示
警告提示
错误提示
vue
<template>
  <x-alert title="成功提示" type="success" />
  <x-alert title="消息提示" type="info" />
  <x-alert title="警告提示" type="warning" />
  <x-alert title="错误提示" type="error" />
</template>

<script setup>
import { Alert } from '@xto/feedback'
</script>

带有辅助性文字介绍

带辅助性文字介绍这是一句描述性文字,用于补充说明提示内容。
vue
<template>
  <x-alert
    title="带辅助性文字介绍"
    type="success"
    description="这是一句描述性文字"
  />
</template>

可关闭

可关闭的提示
vue
<template>
  <x-alert title="可关闭的提示" type="success" closable />
</template>

API

Props

属性说明类型默认值
title标题string
type类型'success' | 'warning' | 'info' | 'error''info'
description辅助性文字string
closable是否可关闭booleantrue
showIcon是否显示图标booleanfalse
center文字是否居中booleanfalse
effect主题'light' | 'dark''light'

Events

事件名说明
close关闭时触发

基于 MIT 许可发布