我就想用两个字符串合成图像的真实路径,习惯上用+,结果报错,不知道JS在页面该怎么组合字符串
wxml文件:
<view class = "order_type_button" wx:for="{{order_type}}" wx:key="id">
<view class = "align_center_hori">
<image class = "toolbar_botton_icon" mode='scaleToFill' src='../../images/person/' + '{{item.image}}'></image>
</view>
</view>
js文件:
data: {
order_type: [
{ image: "order_wait_pay.png" },
{ image: "order_wait_deliver.png" },
{ image: "order_wait_receive.png" },
{ image: "order_finish.png" },
{ image: "order_after_service.png" }
]
},
<image src='../../images/person/{{item.image}}'>
解决了,谢谢你
' + '
删除掉
删除了就报错了:unexpected attribute name
我是叫你删除 ' + ' ,总共三个字符,不是仅+
明白了,谢谢
哈哈哈 还有俩空格~