Skip to content

Tips 提示气泡

用于页面顶部或特定区块内部展示轻量通告信息、警告或状态提醒的提示条组件,支持 4 种状态主题与手动关闭。


代码示例

1. 基础用法 (Basic Usage)

vue
<template>
  <mu-tips type="info" text="提示:您的账号资料完整度已达到 90%" />
  <mu-tips type="success" text="成功:数据已成功同步至本地缓存" />
  <mu-tips type="warning" text="警告:当前处于试用阶段" />
  <mu-tips type="error" text="错误:网络请求连接超时" />
</template>

2. 可手动关闭 (Closable Tips)

设置 closable 属性显示关闭图标按钮。

vue
<template>
  <mu-tips type="info" closable text="请勿将验证码泄露给他人" @close="onClose" />
</template>

<script setup>
function onClose() {
  console.log('提示条已关闭')
}
</script>

API 属性说明 (Props)

参数名说明类型可选值默认值
show / v-model:show控制提示条显示与隐藏Booleantrue | falsetrue
text提示消息文案String-''
type提示消息主题类型Stringinfo | success | warning | error'info'
closable是否显示右侧关闭按钮Booleantrue | falsefalse

事件说明 (Events)

事件名说明回调参数
close点击右侧关闭按钮时触发-
update:show支持 v-model:show 双向绑定更新(show: boolean)

插槽说明 (Slots)

插槽名说明
default自定义提示消息文本内容插槽
icon自定义左侧前置图标插槽

基于 MIT 协议开源发行

H5 模拟器 (tips)☀️🔄