微信小程序url传参写变量的方法
具体代码如下所示:
<navigator url="../../pages/newsDetail/newsDetail?id={{news.id}}"> <view class="list-item"> <view class="little-item"> <view class="left-box"> <image src="{{news.thumb[0]}}"></image> </view> <view class="right-box"> <view class="title">{{news.title}}</view> <view class="info"> <view class="author-info"> <view class="author-avatar"> <image src="{{news.pubInfo.avatarUrl}}"></image> </view> <view class="author-other"> <view>{{news.authorName}}</view> <!-- <view>{{news.pubInfo.introduction}}</view> --> </view> </view> <view>{{news.like}}赞 {{news.createAt}}</view> </view> </view> </view> </view> </navigator>
直接看第一行,直接在双引号里写静态部分,用双大括号绑定变量即可。
总结
相关推荐
kgshuo 2020-09-25
Tomato 2020-09-10
taiyangyu 2020-09-10
CodeAndroid 2020-09-10
small 2020-07-29
sucheng 2020-07-26
zuoliangzhu 2020-07-20
CodeAndroid 2020-07-14
xiaoxubbs 2020-07-04
sucheng 2020-06-25
kgshuo 2020-06-14
意外金喜 2020-06-14
zuoliangzhu 2020-06-14
tianping 2020-06-14
hgzhang 2020-06-14
killgod 2020-06-14
戴翔的技术 2020-06-14
郴州小程序 2020-06-13