Empty 空状态

空状态时的占位提示。

基础用法

description

自定义图片

通过设置 image 属性传入图片 URL。

暂无数据

图片尺寸

通过使用 image-size 属性来控制图片大小。

暂无数据

底部内容

使用默认插槽可在底部插入内容。

暂无数据

自定义样式

您可以为empty组件设置自定义样式。使用 css/scss 语言来更改全局或局部颜色。我们设置了一些全局颜色变量:--el-empty-fill-color-0、--el-empty-fill-color-1、--el-empty-fill-color-2、……、--el-empty-fill-color-9。您可以使用类似 :root { --el-empty-fill-color-0: red; --el-empty-fill-color-1: blue; } 等变量。但通常,如果你想要更改样式,你需要更改所有颜色,因为这些颜色是一个组合。

默认变量

变量颜色
--el-empty-fill-color-0var(--el-color-white)
--el-empty-fill-color-1#fcfcfd
--el-empty-fill-color-2#f8f9fb
--el-empty-fill-color-3#f7f8fc
--el-empty-fill-color-4#eeeff3
--el-empty-fill-color-5#edeef2
--el-empty-fill-color-6#e9ebef
--el-empty-fill-color-7#e5e7e9
--el-empty-fill-color-8#e0e3e9
--el-empty-fill-color-9#d5d7de

Empty API

Empty Attributes

属性名说明类型默认值
image自定义插图地址,不传时使用内置空状态图string—
image-size插图宽度number / string—
description描述文字string / ReactNode暂无数据

Empty Slots

插槽名说明React 写法
default底部内容,通常放操作按钮children
image自定义插图image 属性
description自定义描述description 属性