Skip to content

Empty 内容为空组件

该组件用于需要加载内容,但是加载的第一页数据就为空,提示一个"没有内容"的场景, 我们精心挑选了十几个场景的图标,方便您使用。

📌平台差异说明

APP(vue)H5微信小程序支付宝小程序

🏯基本使用示例

html
<!-- 全局使用 -->
<hy-empty></hy-empty>

显示、配置按钮

  • btnText 显示按钮文本
  • btnSize 按钮大小
  • btnShape 按钮形状
  • btnPlain 按钮是否镂空
  • navigateUrl 跳转页面
html
<template>
    <hy-empty btnText="去购物" btnSize="mini" btnShape="circle" btnPlain navigateUrl="/pages/abc/Index"></hy-empty>
</template>

配置提示文字

  • desSize 提示文本大小
  • desColor 提示文本颜色
html
<template>
    <hy-empty desColor="red" desSize="10px"></hy-empty>
</template>

自定义插槽

html
<template>
    <hy-empty>
        <template #description>
            自定义描述内容
        </template>
    </hy-empty>

    <hy-empty>
        <template>
            自定义默认插槽
        </template>
    </hy-empty>
</template>

API

Empty Props

参数说明类型默认值
show是否显示组件booleantrue
mode缺省页内容stringcontent
imageUrl空状态icon图片string-
zIndex组件层级number889
width图片宽度string|number240px
height图片高度string|number240px
description提示信息string暂无数据
desSize提示信息大小string|number15
desColor提示信息颜色string-
imgMarginicon图片marginstring-
button按钮属性集合,text有值时候显示,详见按钮ApiHyButtonProps-
navigateUrl跳转地址string-
customStyle自定义输入框外部样式CSSProperties-
customClass自定义外部类名string-

Events

事件名说明回调参数
click点击按钮执行函数-

Slots

插槽名说明接收值
default默认插槽-
description自定义底部描述-
13:35