fix picker

This commit is contained in:
cookfront
2017-03-13 19:40:25 +08:00
parent 2db76f207f
commit 3696fadc25
3 changed files with 11 additions and 9 deletions

View File

@@ -14,7 +14,8 @@
:class-name="item.className"
:itemHeight="itemHeight"
:visible-item-count="visibleItemCount"
@change="columnValueChange">
:value-key="valueKey"
@change="columnValueChange(index)">
</picker-column>
<div class="zan-picker-center-highlight" :style="{ height: itemHeight + 'px', marginTop: -itemHeight / 2 + 'px' }"></div>
</div>
@@ -63,7 +64,8 @@ export default {
showToolbar: {
type: Boolean,
default: false
}
},
valueKey: String
},
computed: {
@@ -81,16 +83,16 @@ export default {
methods: {
handlePickerCancel() {
this.$emit('cancel');
this.$emit('cancel', this.values);
},
handlePickerConfirm() {
this.$emit('confirm');
this.$emit('confirm', this.values);
},
/**
* 处理列`change`事件
*/
columnValueChange() {
this.$emit('change', this, this.values);
columnValueChange(index) {
this.$emit('change', this, this.values, index);
},
/**