[Doc] english document of all action components (#260)

* [bugfix] CouponList always show empty info

* [bugfix] add click feedback of buttons in components

* [Doc] add custom theme document

* [new feature] Notice bar support more props

* [bugfix] PullRefresh test cases

* [bugfix] unused NoticeBar style

* [bugfix] Swipe width calc error

* [Doc] english document of all action components
This commit is contained in:
neverland
2017-10-26 08:38:13 -05:00
committed by GitHub
parent 0cae221d5c
commit a7d8379514
10 changed files with 191 additions and 299 deletions
+20 -20
View File
@@ -8,24 +8,26 @@
margin-left: 15px;
}
.title-actionsheet p {
p {
padding: 20px;
}
}
</style>
<script>
import { Toast } from 'packages/index';
export default {
data() {
return {
show1: false,
show2: false,
show3: false,
actions1: [
actions: [
{
name: '微信安全支付',
className: 'actionsheet-wx',
callback: this.handleActionClick
callback: this.onClick
},
{
name: '支付宝支付',
@@ -42,8 +44,8 @@ export default {
},
methods: {
handleActionClick(item) {
console.log(item);
onClick(item) {
Toast(item.name);
}
}
}
@@ -61,14 +63,12 @@ Vue.component(Actionsheet.name, Actionsheet);
### 代码演示
#### 基础用法
需要传入一个`actions`的属性,该属性为一个数组,数组的每一项是一个对象,可以根据下面的[action对象](#actions)设置你想要的信息。
需要传入一个`actions`的数组,数组的每一项是一个对象,对象属性见文档下方表格。
:::demo 基础用法
```html
<van-button @click="show1 = true">弹出actionsheet</van-button>
<van-actionsheet v-model="show1" :actions="actions1">
</van-actionsheet>
<van-button @click="show1 = true">弹出 Actionsheet</van-button>
<van-actionsheet v-model="show1" :actions="actions" />
```
```javascript
@@ -76,11 +76,11 @@ export default {
data() {
return {
show1: false,
actions1: [
actions: [
{
name: '微信安全支付',
className: 'actionsheet-wx',
callback: this.handleActionClick
callback: this.onClick
},
{
name: '支付宝支付',
@@ -97,8 +97,8 @@ export default {
},
methods: {
handleActionClick(item) {
console.log(item);
onClick(item) {
Toast(item.name);
}
}
}
@@ -111,8 +111,8 @@ export default {
:::demo 带取消按钮的 Actionsheet
```html
<van-button @click="show2 = true">弹出带取消按钮的actionsheet</van-button>
<van-actionsheet v-model="show2" :actions="actions1" cancel-text="取消">
<van-button @click="show2 = true">弹出带取消按钮的 Actionsheet</van-button>
<van-actionsheet v-model="show2" :actions="actions" cancel-text="取消">
</van-actionsheet>
```
@@ -121,11 +121,11 @@ export default {
data() {
return {
show2: false,
actions1: [
actions: [
{
name: '微信安全支付',
className: 'actionsheet-wx',
callback: this.handleActionClick
callback: this.onClick
},
{
name: '支付宝支付',
@@ -150,8 +150,8 @@ export default {
:::demo 带标题的 Actionsheet
```html
<van-button @click="show3 = true">弹出带标题的actionsheet</van-button>
<van-actionsheet v-model="show3" title="支持以下配送方式" class="title-actionsheet">
<van-button @click="show3 = true">弹出带标题的 Actionsheet</van-button>
<van-actionsheet v-model="show3" title="支持以下配送方式">
<p>一些内容</p>
</van-actionsheet>
```
+1 -1
View File
@@ -1,6 +1,6 @@
## 更新日志
## [0.10.4](https://github.com/youzan/vant/tree/v0.10.4)
### [0.10.4](https://github.com/youzan/vant/tree/v0.10.4)
`2017-10-26`
**Improvements**
+11 -30
View File
@@ -1,4 +1,6 @@
<script>
import { Toast } from 'packages/index';
export default {
data() {
return {
@@ -10,18 +12,6 @@ export default {
currentDate2: null,
currentDate3: null
};
},
methods: {
handlePickerChange(picker) {
console.log(picker);
},
handlePickerCancel() {
console.log('picker cancel');
},
handlePickerConfirm() {
console.log('picker confirm');
}
}
};
</script>
@@ -48,8 +38,7 @@ Vue.component(DatetimePicker.name, DatetimePicker);
:max-hour="maxHour"
:min-date="minDate"
:max-date="maxDate"
@change="handlePickerChange">
</van-datetime-picker>
/>
```
```javascript
@@ -62,12 +51,6 @@ export default {
maxDate: new Date(2019, 10, 1),
currentDate: new Date(2018, 0, 1)
};
},
methods: {
handlePickerChange(picker) {
console.log(picker);
}
}
};
```
@@ -83,8 +66,7 @@ export default {
:min-hour="minHour"
:max-hour="maxHour"
:min-date="minDate"
@change="handlePickerChange">
</van-datetime-picker>
/>
```
:::
@@ -98,8 +80,7 @@ export default {
:min-hour="minHour"
:max-hour="maxHour"
:min-date="minDate"
@change="handlePickerChange">
</van-datetime-picker>
/>
```
:::
@@ -108,12 +89,12 @@ export default {
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|-----------|-----------|-----------|-------------|-------------|
| visibileColumnCount | 每一列可见备选元素的个数 | Number | 5 | - |
| type | 组件类型 | String | 'datetime' | 'datetime', 'date', 'time' |
| minDate | 可选的最日期 | Date | 十年的 1 月 1 日 | - |
| maxDate | 可选的最大日期 | Date | 十年后的 12 月 31 日 | - |
| minHour | 可选的最小时 | Number | 0 | - |
| maxHour | 可选的最大小时 | Number | 23 | - |
| type | 组件类型 | `String` | 'datetime' | 'date', 'time' |
| minDate | 可选的最小日期 | `Date` | 十年前的 1 月 1 日 | - |
| maxDate | 可选的最日期 | `Date` | 十年的 1231 日 | - |
| minHour | 可选的最小小时 | `Number` | `0` | - |
| maxHour | 可选的最小时 | `Number` | `23` | - |
| visibileColumnCount | 每一列可见备选元素的个数 | `Number` | `5` | - |
### Event
+1 -1
View File
@@ -93,9 +93,9 @@ export default {
:::demo 带toolbar的Picker
```html
<van-picker
show-toolbar
:title="title"
:columns="pickerColumns"
show-toolbar
@change="handlePickerChange"
@cancel="handlePickerCancel"
@confirm="handlePickerConfirm"