uniapp 在函数里面调用一个函数,报undefined
uniapp 在函数里面调用一个函数,报undefined。
·
uniapp 在函数里面调用一个函数,报undefined.
这是因为this的指向问题,把this赋给一个变量就可以了。小问题记录一下
clickLogout:function(){
let _this = this;
_this.$showModal({
title:"",
content:"确定退出登录?",
showCancel:true,
success:function(res){
if(res.confirm){
//uni.clearStorage();
_this.$clearStorage();
uni.navigateTo({
url:'/pages/login/login'
})
}
},
})
},
更多推荐
已为社区贡献1条内容
所有评论(0)