[bugfix] Picker bottom area not dragable (#433)

This commit is contained in:
neverland 2017-12-14 11:27:26 +08:00 committed by GitHub
parent f0143636db
commit 93433249ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="van-picker-column" :class="className"> <div class="van-picker-column" :class="className" :style="columnStyle">
<div class="van-picker-column__frame van-hairline--top-bottom" :style="frameStyle" /> <div class="van-picker-column__frame van-hairline--top-bottom" :style="frameStyle" />
<ul <ul
:style="wrapperStyle" :style="wrapperStyle"
@ -95,14 +95,18 @@ export default create({
return this.options.length; return this.options.length;
}, },
columnStyle() {
return {
height: (this.itemHeight * this.visibileColumnCount) + 'px'
};
},
wrapperStyle() { wrapperStyle() {
const { itemHeight, visibileColumnCount } = this;
return { return {
transition: `${this.duration}ms`, transition: `${this.duration}ms`,
transform: `translate3d(0, ${this.offset}px, 0)`, transform: `translate3d(0, ${this.offset}px, 0)`,
lineHeight: itemHeight + 'px', lineHeight: this.itemHeight + 'px',
height: itemHeight * visibileColumnCount + 'px', padding: `${this.itemHeight * (this.visibileColumnCount - 1) / 2}px 0`
paddingTop: itemHeight * (visibileColumnCount - 1) / 2 + 'px'
}; };
}, },