自定义弹窗组件,设置了占位组件,slot="content"设置了wx:if后偶尔会报错(TypeError: Cannot read property '__slotName' of null);
这个自定义弹窗组件里面有textarea组件,textarea设置了自动聚焦,如果slot="content"不设置设置wx:if,那首词加载的时候,键盘会自动调用再隐藏。
<m-popup show="{{showPopup}}" type="empty">
<view
wx:if="{{showPopup}}"
slot="content"
class="input_case"
style="bottom: {{offsetBottom}}rpx;"
>
<view class="flex-space btn_group" bindtap="togglePopup">
<button class="flex-center btn_w35 radius_r100 back_ffffff">
<iconfont name="close" size="27"></iconfont>
</button>
<button class="flex-center btn_w35 radius_r100 back_ffffff">
<iconfont name="fix" size="27"></iconfont>
</button>
</view>
<view class="flex-center textarea_case">
<m-input
type="textarea"
height="400"
spacing="190"
hold="true"
focus="true"
content="{{desc}}"
placeholder="Podcast Description"
data-field="desc"
bind:input="inputValue"
/>
</view>
</view>
</m-popup>