在小程序的js文件中,有时候我们也要复用同一js的一个或多个方法。如下即可
/**
* 生命周期函数–监听页面显示
*/
onShow: function (options) {
var that=this;
that.queryCartList();
},
queryCartList:function(){
console.log(‘ok’)
}
在小程序的js文件中,有时候我们也要复用同一js的一个或多个方法。如下即可
/**
* 生命周期函数–监听页面显示
*/
onShow: function (options) {
var that=this;
that.queryCartList();
},
queryCartList:function(){
console.log(‘ok’)
}