比如下面的代码我定义了一个test方法我想在页面加载完成后自动调用可为什么无效呢?Page({data:{motto:'HelloWorld',userInfo:{},hasUserInfo:false,canIUse:wx.canIUse('button.open-type.getUserInfo')},test(){console.log(1)},onLoad:function(){this.test}})
Page({data:{motto:'HelloWorld',userInfo:{},hasUserInfo:false,canIUse:wx.canIUse('button.open-type.getUserInfo')},test(){console.log(1)},onLoad:function(){this.test}})
data:{motto:'HelloWorld',userInfo:{},hasUserInfo:false,canIUse:wx.canIUse('button.open-type.getUserInfo')},test(){console.log(1)},onLoad:function(){this.test}})
motto:'HelloWorld',userInfo:{},hasUserInfo:false,canIUse:wx.canIUse('button.open-type.getUserInfo')},test(){console.log(1)},onLoad:function(){this.test}})
userInfo:{},hasUserInfo:false,canIUse:wx.canIUse('button.open-type.getUserInfo')},test(){console.log(1)},onLoad:function(){this.test}})
hasUserInfo:false,canIUse:wx.canIUse('button.open-type.getUserInfo')},test(){console.log(1)},onLoad:function(){this.test}})
canIUse:wx.canIUse('button.open-type.getUserInfo')},test(){console.log(1)},onLoad:function(){this.test}})
},test(){console.log(1)},onLoad:function(){this.test}})
test(){console.log(1)},onLoad:function(){this.test}})
console.log(1)},onLoad:function(){this.test}})
},onLoad:function(){this.test}})
onLoad:function(){this.test}})
this.test}})
}})
})
跃然一笑
相关分类