[new feature] Area add 'title' prop & optimzie Picker performance (#450)

This commit is contained in:
neverland
2017-12-19 09:51:09 +08:00
committed by GitHub
parent 72d4365dfc
commit 48b2026e33
11 changed files with 107 additions and 136 deletions

View File

@@ -19,6 +19,7 @@
:visibileColumnCount="visibileColumnCount"
@change="onChange(index)"
/>
<div class="van-picker__frame van-hairline--top-bottom" :style="frameStyle" />
</div>
</div>
</template>
@@ -41,7 +42,10 @@ export default create({
type: String,
default: 'text'
},
itemHeight: Number,
itemHeight: {
type: Number,
default: 44
},
showToolbar: Boolean,
visibileColumnCount: Number,
columns: {
@@ -67,6 +71,14 @@ export default create({
}
},
computed: {
frameStyle() {
return {
height: this.itemHeight + 'px'
};
}
},
methods: {
initColumns() {
const columns = this.columns.map(deepClone);