Fix wx picker slot (#1280)

* feat: wechat support slot

* feat: picker slot support get params
This commit is contained in:
homi 2024-09-24 17:18:34 +08:00 committed by GitHub
parent d4a3866296
commit 73b809b64f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 63 additions and 31 deletions

View File

@ -40,7 +40,12 @@
placeholder="请选择"
title="请选择"
options="{{list}}"
></ant-picker>
>
<view
slot="content"
slot-scope="prop"
>已选择:{{prop.value}}</view>
</ant-picker>
</ant-list-item>
<view class="btn-wrapper">
<ant-button

View File

@ -7,25 +7,35 @@
style="{{style || ''}}"
onTap="onOpen"
>
<slot name="prefix"></slot>
<slot
name="prefix"
value="{{formatValue}}"
></slot>
<view class="ant-picker-value">
<slot name="content"></slot>
<view
a:if="{{formatValue}}"
class="ant-picker-value-text"
<slot
name="content"
value="{{formatValue}}"
>
{{formatValue}}
</view>
<block a:else>
<view
a:if="{{placeholder}}"
class="ant-picker-value-placeholder"
a:if="{{formatValue}}"
class="ant-picker-value-text"
>
{{placeholder}}
{{formatValue}}
</view>
</block>
<block a:else>
<view
a:if="{{placeholder}}"
class="ant-picker-value-placeholder"
>
{{placeholder}}
</view>
</block>
</slot>
</view>
<slot name="suffix"></slot>
<slot
name="suffix"
value="{{formatValue}}"
></slot>
</view>
<ant-popup
className="ant-picker-popup {{popClassName || ''}}"

View File

@ -34,7 +34,12 @@
placeholder="请选择"
title="请选择"
options="{{list}}"
></ant-picker>
>
<view
slot="content"
slot-scope="prop"
>已选择:{{prop.value}}</view>
</ant-picker>
</ant-list-item>
<view class="btn-wrapper">
<ant-button

View File

@ -7,7 +7,10 @@
style="{{style || ''}}"
bind:tap="onOpen"
>
<slot name="prefix"></slot>
<slot
name="prefix"
value="{{formatValue}}"
></slot>
<view class="ant-picker-value">
<view
wx:if="{{formatValue}}"
@ -20,7 +23,10 @@
>{{placeholder}}</view>
</block>
</view>
<slot name="suffix"></slot>
<slot
name="suffix"
value="{{formatValue}}"
></slot>
</view>
<ant-popup
className="ant-picker-popup {{popClassName || ''}}"

View File

@ -37,7 +37,10 @@
value="{{ value }}"
placeholder="请选择"
title="请选择"
options="{{ list }}" />
options="{{ list }}"
>
<view slot="content" slot-scope="prop" >已选择:{{prop.value}}</view>
</ant-picker>
</ant-list-item>
<view class="btn-wrapper">
<ant-button

View File

@ -6,25 +6,28 @@
class="ant-picker {{ disabled ? 'ant-picker-disabled' : '' }} {{ className || '' }}"
style="{{ style || '' }}"
onTap="onOpen">
<slot name="prefix" />
<slot name="prefix" value="{{formatValue}}" />
<view class="ant-picker-value">
<!-- #if ALIPAY -->
<slot name="content" />
<slot name="content" value="{{formatValue}}" >
<!-- #endif -->
<view
a:if="{{ formatValue }}"
class="ant-picker-value-text">
{{ formatValue }}
</view>
<block a:else>
<view
a:if="{{ placeholder }}"
class="ant-picker-value-placeholder">
{{ placeholder }}
a:if="{{ formatValue }}"
class="ant-picker-value-text">
{{ formatValue }}
</view>
</block>
<block a:else>
<view
a:if="{{ placeholder }}"
class="ant-picker-value-placeholder">
{{ placeholder }}
</view>
</block>
<!-- #if ALIPAY -->
</slot>
<!-- #endif -->
</view>
<slot name="suffix" />
<slot name="suffix" value="{{formatValue}}" />
</view>
<ant-popup
className="ant-picker-popup {{ popClassName || '' }}"