(1)頁面跳轉(zhuǎn)如何傳值(實(shí)現(xiàn)跳轉(zhuǎn)到不同頁面)
點(diǎn)擊頁面
WXML:加入自定義屬性(data-category="{{categoryTitle}}")
<view class="more" catchtap="onMoreTap" data-category="{{categoryTitle}}">
js:在event中取出category值并加到URL中
onMoreTap:function(event){
var category=event.currentTarget.dateset.category;
wx.navigateTo({
url:"more-movie/more-movie?category="+category
})
}
(2)小程序js中兩個(gè)函數(shù)如何傳值
Page({
data:{
navigateTitle:" ",
},
onLoad:function(options){
var category = options.category;
this.data.navigateTitle = category
},
onReady : function(event){
wx.setNavigationBarTitle({
title: this.data.navigateTitle
})
}
})