[new feature] add overlay component

This commit is contained in:
陈嘉涵
2019-07-06 15:18:37 +08:00
parent 22c1b14bc2
commit f6e69f3caa
11 changed files with 280 additions and 16 deletions
+53
View File
@@ -0,0 +1,53 @@
# Overlay
### Install
``` javascript
import { Overlay } from 'vant';
Vue.use(Overlay);
```
## Usage
### Basic Usage
```html
<van-button
type="primary"
text="Show Overlay"
@click="show = true"
/>
<van-overlay
:show="show"
@click="show = false"
/>
```
```js
export default {
data() {
return {
show: false
}
}
},
```
## API
### Props
| Attribute | Description | Type | Default |
|------|------|------|------|
| show | Whether to show overlay | `Boolean` | `false` |
| z-index | z-index | `Number | String` | `1` |
| duration | Animation duration | `Number | String` | `0.3` |
| class-name | ClassName | `String` | - |
### Events
| Event | Description | Arguments |
|------|------|------|
| click | Triggered when clicked | - |