import Vue from 'vue';
import { Empty } from 'vant';
Vue.use(Empty);
<van-empty description="Description" />
Use the image prop to display different placeholder images
<!-- Error -->
<van-empty image="error" description="Description" />
<!-- Network -->
<van-empty image="network" description="Description" />
<!-- Search -->
<van-empty image="search" description="Description" />
<van-empty
class="custom-image"
image="https://img.yzcdn.cn/vant/leaf.jpg"
description="Description"
/>
<style>
.custom-image img {
border-radius: 100%;
}
</style>
<van-empty description="Description">
<van-button round type="danger" class="bottom-button">
Button
</van-button>
</van-empty>
<style>
.bottom-button {
width: 160px;
height: 40px;
}
</style>
| Attribute |
Description |
Type |
Default |
| image |
Image type,can be set to error network search or image URL |
string |
default |
| description |
Desciption |
string |
- |
| Name |
Description |
| default |
Custom bottom content |
| image |
Custom image |
| description |
Custom description |