Skip to content

Commit

Permalink
修复支付宝小程序生成的模板代码中组件名与属性之间缺少空格的问题 (NervJS#14818)
Browse files Browse the repository at this point in the history
* fix(alipay-template): 模板组件名与属性之间缺少空格 NervJS#14806

* fix(template): 插件重载buildThirdPartyAttr方法时可能导致组件名与属性之间缺少空格 NervJS#14806

* fix: ci

---------

Co-authored-by: Chen-jj <798095202@qq.com>
  • Loading branch information
zjcrender and Chen-jj authored Nov 14, 2023
1 parent 3e0936c commit 5fdf9ce
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion packages/shared/src/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ export class BaseTemplate {

template += `
<template name="tmpl_${level}_${compName}">
<${compName}${this.buildThirdPartyAttr(attrs, this.thirdPartyPatcher[compName] || {})} id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">${children}</${compName}>
<${compName} ${this.buildThirdPartyAttr(attrs, this.thirdPartyPatcher[compName] || {})} id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">${children}</${compName}>
</template>
`
}
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-alipay/src/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class Template extends RecursiveTemplate {
return str + `${attr}="eh" `
}

return str + `${attr}="{{ i.${toCamelCase(attr)} }}" `
return str + ` ${attr}="{{ i.${toCamelCase(attr)} }}" `
}, '')
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ require("./taro");
</template>
<template name="tmpl_0_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -719,7 +719,7 @@ require("./taro");
</template>
<template name="tmpl_1_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -783,7 +783,7 @@ require("./taro");
</template>
<template name="tmpl_2_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -847,7 +847,7 @@ require("./taro");
</template>
<template name="tmpl_3_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -903,7 +903,7 @@ require("./taro");
</template>
<template name="tmpl_4_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -959,7 +959,7 @@ require("./taro");
</template>
<template name="tmpl_5_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -1007,7 +1007,7 @@ require("./taro");
</template>
<template name="tmpl_6_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -1055,7 +1055,7 @@ require("./taro");
</template>
<template name="tmpl_7_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -1103,7 +1103,7 @@ require("./taro");
</template>
<template name="tmpl_8_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -1151,7 +1151,7 @@ require("./taro");
</template>
<template name="tmpl_9_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -1199,7 +1199,7 @@ require("./taro");
</template>
<template name="tmpl_10_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -1247,7 +1247,7 @@ require("./taro");
</template>
<template name="tmpl_11_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -1295,7 +1295,7 @@ require("./taro");
</template>
<template name="tmpl_12_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -1343,7 +1343,7 @@ require("./taro");
</template>
<template name="tmpl_13_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -1391,7 +1391,7 @@ require("./taro");
</template>
<template name="tmpl_14_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(15)}}" data="{{i:item,c:c,l:l}}" />
</block>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ require("./runtime");
</template>
<template name="tmpl_0_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -747,7 +747,7 @@ require("./runtime");
</template>
<template name="tmpl_1_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -811,7 +811,7 @@ require("./runtime");
</template>
<template name="tmpl_2_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -875,7 +875,7 @@ require("./runtime");
</template>
<template name="tmpl_3_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -931,7 +931,7 @@ require("./runtime");
</template>
<template name="tmpl_4_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -987,7 +987,7 @@ require("./runtime");
</template>
<template name="tmpl_5_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -1035,7 +1035,7 @@ require("./runtime");
</template>
<template name="tmpl_6_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -1083,7 +1083,7 @@ require("./runtime");
</template>
<template name="tmpl_7_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -1131,7 +1131,7 @@ require("./runtime");
</template>
<template name="tmpl_8_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -1179,7 +1179,7 @@ require("./runtime");
</template>
<template name="tmpl_9_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -1227,7 +1227,7 @@ require("./runtime");
</template>
<template name="tmpl_10_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -1275,7 +1275,7 @@ require("./runtime");
</template>
<template name="tmpl_11_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -1323,7 +1323,7 @@ require("./runtime");
</template>
<template name="tmpl_12_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -1371,7 +1371,7 @@ require("./runtime");
</template>
<template name="tmpl_13_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.a(c, item.nn, l)}}" data="{{i:item,c:c+1,l:xs.f(l,item.nn)}}" />
</block>
Expand Down Expand Up @@ -1419,7 +1419,7 @@ require("./runtime");
</template>
<template name="tmpl_14_tab">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<tab bindmyevent="eh" myProperty="{{i.myProperty}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(15)}}" data="{{i:item,c:c,l:l}}" />
</block>
Expand Down

0 comments on commit 5fdf9ce

Please sign in to comment.