Skip to content

Commit 4239dcb

Browse files
authored
chore(DropdownMenuItem): when option is an empty array, no space is occupied (#3235)
1 parent 55a5e32 commit 4239dcb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/dropdown-item/dropdown-item.wxml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
t-class="{{classPrefix}}__popup-host"
2626
t-class-content="{{classPrefix}}__content {{prefix}}-class-content"
2727
>
28-
<view class="{{classPrefix}}__body">
28+
<view wx:if="{{options && options.length > 0}}" class="{{classPrefix}}__body">
2929
<!-- 单选列表 -->
3030
<scroll-view wx:if="{{!multiple}}" class="{{classPrefix}}__scroll" scroll-y scroll-into-view="id_{{value}}">
3131
<t-radio-group
@@ -56,7 +56,7 @@
5656
class="{{classPrefix}}__checkbox {{prefix}}-class-column"
5757
t-class="{{classPrefix}}__checkbox-group"
5858
style="grid-template-columns: repeat({{optionsColumns}}, 1fr)"
59-
value="{{value}}"
59+
value="{{value ? value : []}}"
6060
bind:change="handleRadioChange"
6161
>
6262
<view wx:for="{{options}}" wx:key="index" id="id_{{item[valueAlias]}}">

0 commit comments

Comments
 (0)