mirror of
https://github.com/youzan/vant.git
synced 2026-01-29 01:15:18 +08:00
Overlay
Install
import Vue from 'vue';
import { Overlay } from 'vant';
Vue.use(Overlay);
Usage
Basic Usage
<van-button type="primary" text="Show Overlay" @click="show = true" />
<van-overlay :show="show" @click="show = false" />
export default {
data() {
return {
show: false
}
}
},
API
Props
| Attribute | Description | Type | Default | Version |
|---|---|---|---|---|
| show | Whether to show overlay | boolean | false |
- |
| z-index | z-index | string | number | 1 |
- |
| duration | Animation duration | string | number | 0.3 |
- |
| class-name | ClassName | string | - | - |
Events
| Event | Description | Arguments |
|---|---|---|
| click | Triggered when clicked | event: Event |
Slots
| Name | Description |
|---|---|
| default | Default slot |