如何实现 替换a出现后 被替换字符1就不出现 替换b 替换2 同理
理想状态是 替换a 啊 替换b
片段:
https://developers.weixin.qq.com/s/0LyAcfm97p7h
js:
data: {
sumKey: [
{ “key”: “替换a”, “id”: “1” },
{ “key”: “替换b”, “id”: “2” }
],
strArray: [‘1’, ‘啊’,‘2’],
},
wxss:
<p wx:for="{{strArray}}" wx:for-item=“strArray”>
<p wx:for-items="{{sumKey}}" wx:for-item=“item”>
<p wx:if="{{item.id==strArray}}">
{{item.key}}
</p>
</p>
{{strArray}}
</p>