Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【taroize】微信小程序转换成taro过程中,wxml中的对象扩展运算符转换失败 #3632

Closed
loosenRogers opened this issue Jul 2, 2019 · 3 comments
Assignees

Comments

@loosenRogers
Copy link

问题描述
[问题描述:taro convert转换微信小程序代码,wxml中的对象扩展运算符转换失败]

复现步骤
[复现问题的步骤]

  1. 进行小程序项目
  2. 项目根目录下执行taro convert
  3. 部分wxml转换出错
  4. 出错内容截图如下

期望行为
[转换正常,不报错]

报错信息

image

系统信息

Taro v1.2 及以上版本已添加 taro info 命令,方便大家查看系统及依赖信息,运行该命令后将结果贴下面即可。

  • 操作系统: [macOS 10.14.5]
  • Taro 版本 [v1.3.2]
  • Node.js 版本 [12.4.0]
  • 报错平台 [h5, weapp]

补充信息
[可选]
[初步判定是wxml中对象扩展运算符转换失败]

@taro-bot
Copy link

taro-bot bot commented Jul 2, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@yuche
Copy link
Contributor

yuche commented Jul 2, 2019

你要带上复现,detail.wxml

@yuche yuche added the taroize label Jul 2, 2019
@loosenRogers
Copy link
Author

你要带上复现,detail.wxml

detail.wxml文件太大了,我贴下另一个报类似错的wxml文件

<view class="popup-mask {{isIphoneX && customs.isDealIphoneX ? 'bottom-34' : ''}}" style="{{maskBgStyle}}{{maskBgAnimate}}"
    hidden='{{!showPop}}' catchtap="{{customs.bgClose ? '_cancel' : ''}}" catchtouchmove='noAction' bindtransitionend="_transitionEnd"></view>
<block wx:if="{{canUseWxs}}">
    <wxs module="touch" src="./popMask.wxs"></wxs>
    <view class="popup-mask-box popup-mask-bottom {{customs.isUseBeforeSlot ? 'before-slot' : ''}} {{isIphoneX && customs.isDealIphoneX ? 'bottom-34' : ''}}"
        style="{{boxStyle}}{{boxAnimate}}" hidden='{{!showPop}}' bindtouchstart="{{touch._onStart}}" catchtouchmove="{{touch._onMove}}"
        bindtouchcancel="{{touch._onEnd}}" bindtouchend="{{touch._onEnd}}" catchtap="noAction" prop="{{boxAnimate}}"
        change:prop="{{touch.propObserver}}" data-isanimating="{{isAnimating}}" data-hidelength="{{hideLength}}">
        <template is="slotBox" data="{{...{customs:customs},isBrace,scrollTop,isAnimating,contentStyle,scrollHeight}}"></template>
    </view>
</block>
<block wx:else>
    <view class="popup-mask-box popup-mask-bottom {{customs.isUseBeforeSlot ? 'before-slot' : ''}} {{isIphoneX && customs.isDealIphoneX ? 'bottom-34' : ''}}"
        style="{{boxStyle}}{{boxAnimate}}" hidden='{{!showPop}}' bindtouchstart="_onStart" catchtouchmove="_onMove"
        bindtouchcancel="_onEnd" bindtouchend="_onEnd" catchtap="noAction">
        <template is="slotBox" data="{{...{customs:customs},isBrace,scrollTop,isAnimating,contentStyle,scrollHeight}}"></template>
    </view>
</block>
<template name="slotBox">
    <block wx:if="{{customs.isUseBeforeSlot}}">
        <view class="flex flex-column">
            <slot name="before" />
            <view class="content-box flex1" style="{{contentStyle}}">
                <view class="scroll-content-box">
                    <template is="maskBox" data="{{...{customs:customs},isBrace,scrollTop,isAnimating,scrollHeight}}"></template>
                </view>
            </view>
        </view>
    </block>
    <block wx:else>
        <template is="maskBox" data="{{...{customs:customs},isBrace,scrollTop,isAnimating,scrollHeight}}"></template>
    </block>
</template>
<template name="maskBox">
    <block wx:if="{{customs.showBtn}}">
        <view wx:if="{{customs.showCloseBtn}}" class="close" catchtap="_cancel">
            <view class="icon-cross"></view>
        </view>
        <view class="flex flex-column">
            <view class="header" style="{{customs.headStyle}}">
                <view class="header-title {{customs.isExplain && !customs.tips ? 'thin-border-bottom' : ''}}" wx:if="{{customs.title}}">
                    <view class="blod">{{customs.title}}</view>
                    <view class="header-subtitle" wx:if="{{customs.subTitle}}">
                        <text>{{customs.subTitle}}</text>
                    </view>
                </view>
                <view class="tips" wx:if="{{customs.tips}}">
                    <text>{{customs.tips}}</text>
                </view>
            </view>
            <view wx:if="{{!customs.scrollToView}}" class="popup-body flex1 {{customs.isExplain ? 'bg-fff' : ''}}">
                <scroll-view scroll-y="true" scroll-top="{{scrollTop}}" class="scroll-view" style="height: {{scrollHeight}};">
                    <!--处理下拉刷新问题 scroll-view如果能滚动起来就不会冒泡,所以将蒙版里的scroll-view的内容的最小高度设为scroll-view的高度加1px-->
                    <view class="scroll-content">
                        <!-- 解决margin塌陷问题 -->
                        <view class="take-place"></view>
                        <slot />
                        <view class="take-place"></view>
                    </view>
                    <view wx:if="{{isBrace}}" style="height: 1px;"></view>
                </scroll-view>
                <view hidden="{{!isAnimating}}" class="no-action" catchtap="noAction"></view>
            </view>
            <!-- 开启scrollToView,设置滚动需要到插槽内部实现 -->
            <view wx:else class="popup-body flex1">
                <slot />
                <view hidden="{{!isAnimating}}" class="no-action" catchtap="noAction"></view>
            </view>
            <view class="tips" wx:if="{{customs.bottomTips}}">
                <text>{{customs.bottomTips}}</text>
            </view>
            <view class="popup-footer flex" wx:if="{{customs.buttons.length == 1}}">
                <view class="popup-btn flex1" style="{{customs.buttons[0].bgColor ? 'background-color:' + customs.buttons[0].bgColor + ';' : ''}}{{customs.buttons[0].color ? 'color:' + customs.buttons[0].color + ';' : ''}}"
                    data-index="0" bindtap="btnClick">
                    {{customs.buttons[0].txt}}
                </view>
            </view>
            <view class="popup-footers flex" wx:elif="{{customs.buttons.length == 2}}">
                <view class="popup-btn flex1 {{index == 0 ? 'first-btn thin-border-all' : ''}}" wx:for="{{customs.buttons}}"
                    wx:key="key" wx:if="{{item.txt}}" style="{{item.bgColor ? 'background-color:' + item.bgColor + ';' : ''}}{{item.color ? 'color:' + item.color + ';' : ''}}"
                    data-index="{{index}}" bindtap="btnClick">
                    {{item.txt}}
                </view>
            </view>
        </view>
    </block>
    <block wx:else>
        <slot />
        <view hidden="{{!isAnimating}}" class="no-action" catchtap="noAction"></view>
    </block>
</template>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants