docs(Popover): add select event demo

This commit is contained in:
chenjiahan
2020-11-20 14:26:41 +08:00
committed by neverland
parent 27ed9d1fb7
commit 1999195c46
3 changed files with 27 additions and 2 deletions
+8 -1
View File
@@ -14,7 +14,7 @@ Vue.use(Popover);
### Basic Usage
```html
<van-popover v-model="showPopover" :actions="actions">
<van-popover v-model="showPopover" :actions="actions" @select="onSelect">
<template #reference>
<van-button type="primary" @click="showPopover = true">
Light Theme
@@ -24,6 +24,8 @@ Vue.use(Popover);
```
```js
import { Toast } from 'vant';
export default {
data() {
return {
@@ -35,6 +37,11 @@ export default {
],
};
},
methods: {
onSelect(action) {
Toast(action.text);
},
},
};
```