微信小程序頁面獲取數據的案例:
獲取page數據,代碼:var text=this.data.name ,這樣就獲取到初始化的值。
page({data:{name:"test"},showData:function(){var text=this.data.name}})
data:{name:"test"},
showData:function(){
var text=this.data.name
}
})