[new feature] Picker: add toolbar-position prop

This commit is contained in:
akebe 2019-06-09 09:48:01 +08:00 committed by neverland
parent 168730d2ac
commit 04b88583c2

View File

@ -16,6 +16,10 @@ export default sfc({
type: Number, type: Number,
default: 0 default: 0
}, },
toolbarPosition: {
type: String,
default: 'top'
},
valueKey: { valueKey: {
type: String, type: String,
default: 'text' default: 'text'
@ -176,7 +180,7 @@ export default sfc({
return ( return (
<div class={bem()}> <div class={bem()}>
{Toolbar} {this.toolbarPosition === 'top' ? Toolbar : h()}
{this.loading ? <Loading class={bem('loading')} color={BLUE} /> : h()} {this.loading ? <Loading class={bem('loading')} color={BLUE} /> : h()}
<div class={bem('columns')} style={columnsStyle} onTouchmove={preventDefault}> <div class={bem('columns')} style={columnsStyle} onTouchmove={preventDefault}>
{columns.map((item, index) => ( {columns.map((item, index) => (
@ -195,6 +199,7 @@ export default sfc({
<div class={bem('mask')} style={maskStyle} /> <div class={bem('mask')} style={maskStyle} />
<div class={['van-hairline--top-bottom', bem('frame')]} style={frameStyle} /> <div class={['van-hairline--top-bottom', bem('frame')]} style={frameStyle} />
</div> </div>
{this.toolbarPosition === 'bottom' ? Toolbar : h()}
</div> </div>
); );
} }