Skip to content

空内容 Empty

空内容组件。

兼容性

  • 兼容:✅
  • 不兼容:❌
  • 未知:❔
H5安卓苹果微信支付宝百度抖音QQ快手飞书京东
小红书鸿蒙360华为快应用快应用联盟

插件市场地址

DCloud 插件市场地址

基础使用

  • 通过 icon 属性设置图标。
  • 通过 tip 属性设置提示语,如果 tip 为空,则提示语不显示。
vue
<template>
    <pure-empty icon="empty" tip="购物车空空如也~"></pure-empty>
</template>

底部按钮

  • 通过 btn 属性设置是否显示底部按钮。
  • 通过 btnClass 属性给按钮添加类名。
  • 通过 btnProps 属性设置按钮 props,对应 pure-button 组件的 props
vue
<template>
    <pure-empty btn btnClass="pure-button-warning" :btnProps="btnProps"></pure-empty>
</template>

<script setup>
import { ref } from 'vue';

const btnProps = ref({
    text: '去逛逛',
});
</script>

Props

属性名说明类型默认值可选值版本
icon图标名称,同图标组件(Icon)的 name 属性,参考String__wupin-+1.0.0
mode图片图标的裁剪模式,同图标组件(Icon)的 mode 属性,参考StringheightFix-+1.0.0
tip提示语String暂无数据-+1.0.0
btn是否显示默认按钮Booleanfalsetrue+1.0.0
btnClass默认按钮的自定义类名Stringpure-button-success-+1.0.0
btnProps默认按钮的配置对象,参考Objectnull-+1.0.0

Event

事件名说明回调参数版本
<pure-button> 组件的事件参考-1.0.0

Slots

名称说明参数版本
icon图标-+1.0.0
tip提示-+1.0.0
default底部-+1.0.0

基于 MIT 许可发布