今天绵阳动力网站建设再次为大家带来微信小程序的开发教程,希望对做微信小程序开发的童学有帮助。今天主要介绍的内容是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>直接看第一行,直接在双引号里写静态部分,用双大括号绑定变量即可。是不是很简单,当然你也可以结合官方教程来进行开发。
地址:绵阳市临园路东段78号B座13层
电话:0816-6339181
邮箱:kf@kf51.cn
微信公众号:
Copyright © 绵阳动力网站建设 www.kf51.cn All Rights Reserved 蜀ICP备08100083号
