Skip to content

Commit 2e0ec90

Browse files
authoredFeb 15, 2023
Merge pull request #192 from airbnb/fix-baidu-flatten-text-template
Fix an issue of Baidu flatten text template that cause missing text on production mode
2 parents c7bc52e + 10a5266 commit 2e0ec90

File tree

1 file changed

+6
-6
lines changed
  • packages/webpack-plugin/src/templates/components/components.wxml

1 file changed

+6
-6
lines changed
 

‎packages/webpack-plugin/src/templates/components/components.wxml/flatten.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ export const FlattenText = () => {
1010
return t`
1111
<text wx:elif="{{${ids.meta}.${ids.type} === 'text'}}" data-goji-id="{{${ids.meta}.${ids.gojiId} || -1}}" id="{{${ids.meta}.${ids.props}.id}}" class="{{${ids.meta}.${ids.props}.className}}" style="{{${ids.meta}.${ids.props}.style || ''}}" selectable="{{${ids.meta}.${ids.props}.selectable}}" space="{{${ids.meta}.${ids.props}.space}}" decode="{{${ids.meta}.${ids.props}.decode}}" bindtouchstart="e" bindtouchmove="e" bindtouchcancel="e" bindtouchend="e" bindtap="e" bindlongpress="e" bindlongtap="e" bindtransitionend="e" bindanimationstart="e" bindanimationiteration="e" bindanimationend="e" bindtouchforcechange="e">
1212
<block wx:for="{{${ids.meta}.${ids.children}}}" wx:key="${ids.gojiId}">
13-
<block wx:if="{{item.${ids.type} === 'GOJI_TYPE_TEXT'}}">{{item.text}}</block>
13+
<block wx:if="{{item.${ids.type} === 'GOJI_TYPE_TEXT'}}">{{item.${ids.text}}}</block>
1414
<text wx:elif="item.${ids.type} === 'text'" data-goji-id="{{item.${ids.gojiId} || -1}}" id="{{${ids.meta}.${ids.props}.id}}" class="{{item.${ids.props}.className}}" style="{{item.${ids.props}.style || ''}}" selectable="{{item.${ids.props}.selectable}}" space="{{item.${ids.props}.space}}" decode="{{item.${ids.props}.decode}}" bindtouchstart="e" bindtouchmove="e" bindtouchcancel="e" bindtouchend="e" bindtap="e" bindlongpress="e" bindlongtap="e" bindtransitionend="e" bindanimationstart="e" bindanimationiteration="e" bindanimationend="e" bindtouchforcechange="e">
1515
<block wx:for="{{item.${ids.children}}}" wx:key="${ids.gojiId}">
16-
<block wx:if="{{item.${ids.type} === 'GOJI_TYPE_TEXT'}}">{{item.text}}</block>
16+
<block wx:if="{{item.${ids.type} === 'GOJI_TYPE_TEXT'}}">{{item.${ids.text}}}</block>
1717
<text wx:elif="item.${ids.type} === 'text'" data-goji-id="{{item.${ids.gojiId} || -1}}" id="{{${ids.meta}.${ids.props}.id}}" class="{{item.${ids.props}.className}}" style="{{item.${ids.props}.style || ''}}" selectable="{{item.${ids.props}.selectable}}" space="{{item.${ids.props}.space}}" decode="{{item.${ids.props}.decode}}" bindtouchstart="e" bindtouchmove="e" bindtouchcancel="e" bindtouchend="e" bindtap="e" bindlongpress="e" bindlongtap="e" bindtransitionend="e" bindanimationstart="e" bindanimationiteration="e" bindanimationend="e" bindtouchforcechange="e">
1818
<block wx:for="{{item.${ids.children}}}" wx:key="${ids.gojiId}">
19-
<block wx:if="{{item.${ids.type} === 'GOJI_TYPE_TEXT'}}">{{item.text}}</block>
19+
<block wx:if="{{item.${ids.type} === 'GOJI_TYPE_TEXT'}}">{{item.${ids.text}}}</block>
2020
<text wx:elif="item.${ids.type} === 'text'" data-goji-id="{{item.${ids.gojiId} || -1}}" id="{{${ids.meta}.${ids.props}.id}}" class="{{item.${ids.props}.className}}" style="{{item.${ids.props}.style || ''}}" selectable="{{item.${ids.props}.selectable}}" space="{{item.${ids.props}.space}}" decode="{{item.${ids.props}.decode}}" bindtouchstart="e" bindtouchmove="e" bindtouchcancel="e" bindtouchend="e" bindtap="e" bindlongpress="e" bindlongtap="e" bindtransitionend="e" bindanimationstart="e" bindanimationiteration="e" bindanimationend="e" bindtouchforcechange="e">
2121
<block wx:for="{{item.${ids.children}}}" wx:key="${ids.gojiId}">
22-
<block wx:if="{{item.${ids.type} === 'GOJI_TYPE_TEXT'}}">{{item.text}}</block>
22+
<block wx:if="{{item.${ids.type} === 'GOJI_TYPE_TEXT'}}">{{item.${ids.text}}}</block>
2323
<text wx:elif="item.${ids.type} === 'text'" data-goji-id="{{item.${ids.gojiId} || -1}}" id="{{${ids.meta}.${ids.props}.id}}" class="{{item.${ids.props}.className}}" style="{{item.${ids.props}.style || ''}}" selectable="{{item.${ids.props}.selectable}}" space="{{item.${ids.props}.space}}" decode="{{item.${ids.props}.decode}}" bindtouchstart="e" bindtouchmove="e" bindtouchcancel="e" bindtouchend="e" bindtap="e" bindlongpress="e" bindlongtap="e" bindtransitionend="e" bindanimationstart="e" bindanimationiteration="e" bindanimationend="e" bindtouchforcechange="e">
2424
<block wx:for="{{item.${ids.children}}}" wx:key="${ids.gojiId}">
25-
<block wx:if="{{item.${ids.type} === 'GOJI_TYPE_TEXT'}}">{{item.text}}</block>
25+
<block wx:if="{{item.${ids.type} === 'GOJI_TYPE_TEXT'}}">{{item.${ids.text}}}</block>
2626
<text wx:elif="item.${ids.type} === 'text'" data-goji-id="{{item.${ids.gojiId} || -1}}" id="{{${ids.meta}.${ids.props}.id}}" class="{{item.${ids.props}.className}}" style="{{item.${ids.props}.style || ''}}" selectable="{{item.${ids.props}.selectable}}" space="{{item.${ids.props}.space}}" decode="{{item.${ids.props}.decode}}" bindtouchstart="e" bindtouchmove="e" bindtouchcancel="e" bindtouchend="e" bindtap="e" bindlongpress="e" bindlongtap="e" bindtransitionend="e" bindanimationstart="e" bindanimationiteration="e" bindanimationend="e" bindtouchforcechange="e">
2727
<block wx:for="{{item.${ids.children}}}" wx:key="${ids.gojiId}">
28-
<block wx:if="{{item.${ids.type} === 'GOJI_TYPE_TEXT'}}">{{item.text}}</block>
28+
<block wx:if="{{item.${ids.type} === 'GOJI_TYPE_TEXT'}}">{{item.${ids.text}}}</block>
2929
<text wx:elif="item.${ids.type} === 'text'" data-goji-id="{{item.${ids.gojiId} || -1}}" id="{{${ids.meta}.${ids.props}.id}}" class="{{item.${ids.props}.className}}" style="{{item.${ids.props}.style || ''}}" selectable="{{item.${ids.props}.selectable}}" space="{{item.${ids.props}.space}}" decode="{{item.${ids.props}.decode}}" bindtouchstart="e" bindtouchmove="e" bindtouchcancel="e" bindtouchend="e" bindtap="e" bindlongpress="e" bindlongtap="e" bindtransitionend="e" bindanimationstart="e" bindanimationiteration="e" bindanimationend="e" bindtouchforcechange="e"></text>
3030
</block>
3131
</text>

0 commit comments

Comments
 (0)
Please sign in to comment.