Skip to content

mms-empty 空状态

简述

空状态时的占位提示,用于列表为空、没有数据等场景。

注意

注意: 请以 uni_modules/mms-unix 与本文为准;各端差异以 uni-app 与各平台官方文档为准。涉及隐私能力(相册、定位、剪贴板、手机号等)需在 manifest 与后台完成配置。

平台差异说明

App(vue)App(nvue)H5小程序

基本使用

uvue
<template>
	<mms-empty description="暂无数据"></mms-empty>
</template>

Props

参数说明类型默认值
image自定义图片 URLstring''
description文字说明string暂无数据
textdescription 相同含义,非空时优先显示string''
iconmms-iconname;未传且未使用 image 时,默认使用内置图标 file-common-filling(不依赖 /static 插图)string''
paddingTop区域距离顶部距离(数字默认 rpx)number | string200

插槽

名称说明
icon自定义图标;不写则用默认 mms-iconfile-common-filling
footer底部内容,一般放按钮
default底部内容,与 footer 可同时使用

底部使用 mms-button 时,请用 btnSize(如 small)控制按钮规格;mms-buttonsize 表示字号 rpx,写成 size="small" 不会得到小按钮,且默认 width 为 100% 会拉满一行。

示例

基础用法

uvue
<mms-empty description="暂无合同数据"></mms-empty>

自定义图片

uvue
<mms-empty
	description="暂无数据"
	image="https://example.com/empty.png"
></mms-empty>

底部按钮

uvue
<mms-empty description="暂无数据">
	<template #footer>
		<mms-button type="primary" btnSize="small">去添加</mms-button>
	</template>
</mms-empty>

Released under the MIT License.