提交 bb130c16 编写于 作者: A Amy 提交者: doly mood

Add: Picker swipeTime (#104)

* <add>(picker): swipeTime

* <update>(doc): pickers
上级 64dc810d
......@@ -222,8 +222,9 @@
| title | title | String | '' | - |
| data | the cascading data used to init option items | Array | [] | - |
| selectedIndex | the index of the selected item, corresponding content will be displayed when picker shows | Array | [] | [1] |
| cancelTxt | the text of the left button in picker | String | '取消' | - |
| confirmTxt | the text of the right button in picker | String | '确定' | - |
| cancelTxt | the text of the cancel button | String | '取消' | - |
| confirmTxt | the text of the confirm button | String | '确定' | - |
| swipeTime | the duration of the momentum animation when user flicks the wheel of the picker, Unit: ms | Number | 2500 | - |
| alias | configure the alias of `value` and `text`, used as same as the alias of `Picker` component | Object | {} | { value: 'id', text: 'name'} |
* `data` sub configuration
......
......@@ -182,8 +182,9 @@
| title | title | String | '' | - |
| data | data that passed into picker, whose length determines the columns of picker | Array | [] | - |
| selectedIndex | the index of the selected value, corresponding content will be displayed when picker shows | Array | [] | [1] |
| cancelTxt | the text of the left button in picker | String | '取消' | - |
| confirmTxt | the text of the right button in picker | String | '确定' | - |
| cancelTxt | the text of the cancel button | String | '取消' | - |
| confirmTxt | the text of the confirm button | String | '确定' | - |
| swipeTime | the duration of the momentum animation when user flicks the wheel of the picker, Unit: ms | Number | 2500 | - |
| alias | configure the alias of `value` and `text` | Object | {} | { value: 'id', text: 'name'} |
* `data` sub configuration
......
......@@ -142,6 +142,7 @@
| Attribute | Description | Type | Default |
| - | - | - | - |
| title | title | String | '选择时间' |
| swipeTime | the duration of the momentum animation when user flicks the wheel of the picker, Unit: ms | Number | 2500 |
| delay | minutes that postponed backwards from now, which determines the minimal optional time| Number | 15 |
| day | date configuration | Object | { len: 3, filter: ['今日'], format: 'M月d日' } |
| showNow | whether to display current time | Boolean | true |
......
......@@ -213,8 +213,9 @@
| title | 标题 | String | '' | - |
| data | 级联选择器的树形数据,用于初始化选项 | Array | [] | - |
| selectedIndex | 被选中的索引值,拉起选择器后显示这个索引值对应的内容 | Array | [] | [1] |
| cancelTxt | 选择器左侧按钮文案 | String | '取消' | - |
| confirmTxt | 选择器右侧按钮文案 | String | '确定' | - |
| cancelTxt | 取消按钮文案 | String | '取消' | - |
| confirmTxt | 确定按钮文案 | String | '确定' | - |
| swipeTime | 快速滑动选择器滚轮时,惯性滚动动画的时长,单位:ms | Number | 2500 | - |
| alias | 配置`value``text`的别名,用法同`Picker`组件 | Object | {} | { value: 'id', text: 'name'} |
* `data`子配置项
......
......@@ -180,10 +180,11 @@
| 参数 | 说明 | 类型 | 默认值 | 示例 |
| - | - | - | - | - |
| title | 标题 | String | '' | - |
| data | 传入picker数据,数组的长度决定了picker的列数 | Array | [] | - |
| selectedIndex | 被选中的索引值,拉起picker后显示这个索引值对应的内容 | Array | [] | [1] |
| cancelTxt | picker左侧按钮文案 | String | '取消' | - |
| confirmTxt | picker右侧按钮文案 | String | '确定' | - |
| data | 传入 picker 数据,数组的长度决定了 picker 的列数 | Array | [] | - |
| selectedIndex | 被选中的索引值,拉起 picker 后显示这个索引值对应的内容 | Array | [] | [1] |
| cancelTxt | 取消按钮文案 | String | '取消' | - |
| confirmTxt | 确定按钮文案 | String | '确定' | - |
| swipeTime | 快速滑动 picker 滚轮时,惯性滚动动画的时长,单位:ms | Number | 2500 | - |
| alias | 配置`value``text`的别名 | Object | {} | { value: 'id', text: 'name'} |
* `data`子配置项
......
......@@ -132,6 +132,7 @@
| 参数 | 说明 | 类型 | 默认值 |
| - | - | - | - |
| title | 标题 | String | '选择时间' |
| swipeTime | 快速滑动选择器滚轮时,惯性滚动动画的时长,单位:ms | Number | 2500 |
| delay | 将当前时间向后推算的分钟数,决定了最小可选时间 | Number | 15 |
| day | 日期配置 | Object | { len: 3, filter: ['今日'], format: 'M月d日' } |
| showNow | 是否显示当前时间 | Boolean | true |
......
......@@ -5,8 +5,9 @@
:data="pickerData"
:selected-index="pickerSelectedIndex"
:z-index="zIndex"
:cancelTxt="cancelTxt"
:confirmTxt="confirmTxt"
:cancel-txt="cancelTxt"
:confirm-txt="confirmTxt"
:swipe-time="swipeTime"
@select="_pickerSelect"
@cancel="_pickerCancel"
@change="_pickerChange"></cube-picker>
......@@ -54,6 +55,10 @@
type: String,
default: '确定'
},
swipeTime: {
type: Number,
default: 2500
},
alias: {
type: Object,
default() {
......
......@@ -60,6 +60,12 @@
return []
}
},
selectedIndex: {
type: Array,
default() {
return []
}
},
title: {
type: String
},
......@@ -71,11 +77,9 @@
type: String,
default: '确定'
},
selectedIndex: {
type: Array,
default() {
return []
}
swipeTime: {
type: Number,
default: 2500
},
alias: {
type: Object,
......@@ -247,6 +251,7 @@
wheel: {
selectedIndex: this.pickerSelectedIndex[i] || 0
},
swipeTime: this.swipeTime,
observeDOM: false
})
wheel.on('scrollEnd', () => {
......
......@@ -5,6 +5,7 @@
:data="data"
:selected-index="selectedIndex"
:z-index="zIndex"
:swipe-time="swipeTime"
@select="_pickerSelect"
@cancel="_pickerCancel"
@change="_pickerChange"></cube-picker>
......@@ -48,6 +49,10 @@
type: String,
default: '选择时间'
},
swipeTime: {
type: Number,
default: 2500
},
delay: {
type: Number,
default: 15
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册