taro 2.2.11 微信编译出错 H5编译没有问题



  •             if (modalTitle && createTitle.length > 0) {
       
                    if (modalDesc && modalDesc.length > 0) {
        
                        return (
        
                            <AtModalHeader>
        
                                <View className='due-checkbox__modal-title'>{modalTitle}</View>
        
                                <View className='due-checkbox__modal-desc'>{modalDesc}</View>
        
                            </AtModalHeader>
        
                        )
        
                    } else if(modalDesc && modalDesc.length <= 0) {
        
                        return (
        
                            <AtModalHeader>{modalTitle}</AtModalHeader>
        
                        )
        
                    }
        
                } else if(modalTitle && createTitle.length <= 0){
        
                    if (modalDesc && modalDesc.length > 0) {
        
                        return (
        
                            <AtModalHeader>{modalDesc}</AtModalHeader>
        
                        )
        
                    }
        
                }   
    

    微信开发者工具却显示wx:elif 开始 并不是wx:if 开始 最外层的if判断已消失

    <block>
      <block wx:elif="{{modalDesc && modalDesc.length > 0}}">
            <at-modal-header>
                <view class="due-checkbox__modal-title">{{modalTitle}}</view>
                <view class="due-checkbox__modal-desc">{{modalDesc}}</view>
            </at-modal-header>
        </block>
        <block wx:elif="{{modalDesc && modalDesc.length <= 0}}">
            <at-modal-header>{{modalTitle}}</at-modal-header>
        </block>
        <block wx:elif="{{modalDesc && modalDesc.length > 0}}">
            <at-modal-header>{{modalDesc}}</at-modal-header>
        </block>
    </block>


  • 需要提交个 issue 附带最小可复现的demo哦


登录后回复