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

代码转化问题 #161

Open
fastknifes opened this issue Aug 25, 2023 · 3 comments
Open

代码转化问题 #161

fastknifes opened this issue Aug 25, 2023 · 3 comments

Comments

@fastknifes
Copy link

fastknifes commented Aug 25, 2023

以下问题仅限个人转化自己项目中遇到的情况, 并非泛指所有。

转换1

原代码:

 <view class='fz32 c000 nameView'>{{item.partner.partner_name}}({{item.partner.mobile}})</view>

转化后的代码:

<view class="fz32 c" 000' nameView'>{{item.partner.partner_name}}({{item.partner.mobile}})</view>

貌似所有遇到 000 这样的字符都会被处理成这样。

转换2

原代码:

  <template is='noMoreData' wx:if="{{noMoreData}}"></template>

转化后的代码:

    <block name="noMoreData" v-if="false" v-if="noMoreData">
    </block>

会多一个 if判断

转换3

原代码:

 if (api_token){
     typeof callback ==='function'?callback():'';
      return ;
  }

转化后:

if (api_token) {
       if (typeof callback === 'function') {
           callback();
       } else {
           ('');
       }
       return;
   }
@zhangdaren
Copy link
Owner

第一个和第三个貌似已经解决,,第二个貌似解决了,,忘了,待测。

@zhaoguoweiLLHC
Copy link

第二个在2.2.6版试下了,还是会有
转化前

<template wx:else is="flight"></template> 

转化后

<block name="flight" v-if="false" v-else></block>

@zhangdaren
Copy link
Owner

zhangdaren commented Dec 20, 2023 via email

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

3 participants