mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
feat(Picker): add toolbar-position prop (#2040)
This commit is contained in:
parent
9dc028b96e
commit
f4a58f3ac3
@ -149,6 +149,7 @@ Page({
|
||||
|------|------|------|------|------|
|
||||
| columns | 对象数组,配置每一列显示的数据 | *Array* | `[]` | - |
|
||||
| show-toolbar | 是否显示顶部栏 | *boolean* | `false` | - |
|
||||
| toolbar-position | 顶部栏位置,可选值为`bottom` | *string* | `top` | - |
|
||||
| title | 顶部栏标题 | *string* | `''` | - |
|
||||
| loading | 是否显示加载状态 | *boolean* | `false` | - |
|
||||
| value-key | 选项对象中,文字对应的 key | *string* | `text` | - |
|
||||
|
@ -16,6 +16,10 @@ VantComponent({
|
||||
type: String,
|
||||
value: 'text'
|
||||
},
|
||||
toolbarPosition: {
|
||||
type: String,
|
||||
value: 'top'
|
||||
},
|
||||
defaultIndex: {
|
||||
type: Number,
|
||||
value: 0
|
||||
|
@ -1,4 +1,4 @@
|
||||
<view class="van-picker custom-class">
|
||||
<template name="toolbar">
|
||||
<view
|
||||
wx:if="{{ showToolbar }}"
|
||||
class="van-picker__toolbar van-hairline--top-bottom toolbar-class"
|
||||
@ -23,6 +23,10 @@
|
||||
{{ confirmButtonText }}
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<view class="van-picker custom-class">
|
||||
<template is="toolbar" wx:if="{{ toolbarPosition === 'top' }}" data="{{ showToolbar, cancelButtonText, title, confirmButtonText }}"></template>
|
||||
<view wx:if="{{ loading }}" class="van-picker__loading">
|
||||
<loading color="#1989fa"/>
|
||||
</view>
|
||||
@ -50,6 +54,7 @@
|
||||
style="height: {{ itemHeight }}px"
|
||||
/>
|
||||
</view>
|
||||
<template is="toolbar" wx:if="{{ toolbarPosition === 'bottom' }}" data="{{ showToolbar, cancelButtonText, title, confirmButtonText }}"></template>
|
||||
</view>
|
||||
|
||||
<wxs module="isSimple">
|
||||
|
Loading…
x
Reference in New Issue
Block a user