[new feature] add i18n support (#310)
* fix: Tabbar icon line-height * [new feature] progress add showPivot prop * [new feature] TabItem support vue-router * [new feature] update document header style * [Doc] add toast english ducoment * [new feature] add i18n support * feat: Extract demos from markdown * feat: Base components demos * [new feature] complete demo extract & translate * [fix] text cases * fix: add deepAssign test cases * fix: changelog detail * [new feature] AddressEdit support i18n
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
## Actionsheet
|
||||
|
||||
### Install
|
||||
``` javascript
|
||||
import { Actionsheet } from 'vant';
|
||||
|
||||
Vue.component(Actionsheet.name, Actionsheet);
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
#### Basic Usage
|
||||
Use `actions` prop to set options of actionsheet.
|
||||
|
||||
```html
|
||||
<van-actionsheet v-model="show" :actions="actions" />
|
||||
```
|
||||
|
||||
```javascript
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
actions: [
|
||||
{ name: 'Option1', callback: this.onClick },
|
||||
{ name: 'Option2' },
|
||||
{ name: 'Option3', loading: true }
|
||||
]
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
onClick(item) {
|
||||
Toast(item.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Actionsheet with cancel button
|
||||
|
||||
```html
|
||||
<van-actionsheet v-model="show" :actions="actions" cancelText="Cancel" />
|
||||
```
|
||||
|
||||
#### Actionsheet with title
|
||||
Actionsheet will get another style if there is a `title` prop.
|
||||
|
||||
```html
|
||||
<van-actionsheet v-model="show" title="Title">
|
||||
<p>Content</p>
|
||||
</van-actionsheet>
|
||||
```
|
||||
|
||||
### API
|
||||
|
||||
| Attribute | Description | Type | Default | Accepted Values |
|
||||
|-----------|-----------|-----------|-------------|-------------|
|
||||
| actions | Options | `Array` | `[]` | - |
|
||||
| title | Title | `String` | - | - |
|
||||
| cancelText | Text of cancel button | `String` | - | - |
|
||||
| overlay | Whether to show overlay | `Boolean` | - | - |
|
||||
| closeOnClickOverlay | Whether to close when click overlay | `Boolean` | - | - |
|
||||
|
||||
### Data struct of actions
|
||||
|
||||
| key | Description |
|
||||
|-----------|-----------|
|
||||
| name | Title |
|
||||
| subname | Subtitle |
|
||||
| className | className for the option |
|
||||
| loading | Whether to be loading status |
|
||||
| callback | Triggered when click option |
|
||||
Reference in New Issue
Block a user