feat(ActionSheet): add description prop (#4691)

This commit is contained in:
neverland
2019-10-11 15:28:52 +08:00
committed by GitHub
parent 79322ea892
commit 9f523682e0
9 changed files with 133 additions and 36 deletions
+30 -10
View File
@@ -16,11 +16,7 @@ Vue.use(ActionSheet);
Use `actions` prop to set options of action-sheet.
```html
<van-action-sheet
v-model="show"
:actions="actions"
@select="onSelect"
/>
<van-action-sheet v-model="show" :actions="actions" @select="onSelect" />
```
```javascript
@@ -48,10 +44,7 @@ export default {
### Status
```html
<van-action-sheet
v-model="show"
:actions="actions"
/>
<van-action-sheet v-model="show" :actions="actions" />
```
```javascript
@@ -76,11 +69,37 @@ export default {
v-model="show"
:actions="actions"
cancel-text="Cancel"
@select="onSelect"
@cancel="onCancel"
/>
```
```js
export default {
data() {
return {
show: false
};
},
methods: {
onCancel() {
this.show = false;
Toast('cancel');
}
}
}
```
### Show Description
```html
<van-action-sheet
v-model="show"
:actions="actions"
description="Description"
/>
```
### ActionSheet with title
```html
@@ -98,6 +117,7 @@ export default {
| actions | Options | *Action[]* | `[]` | - |
| title | Title | *string* | - | - |
| cancel-text | Text of cancel button | *string* | - | - |
| description | Description above the options | *string* | - | 2.2.8 |
| overlay | Whether to show overlay | *boolean* | `true` | - |
| round | Whether to show round corner | *boolean* | `true` | 2.0.9 |
| close-on-click-action | Whether to close when click action | *boolean* | `false` | - |