0
点赞
收藏
分享

微信扫一扫

在vue里面使用原生的js内置函数

大南瓜鸭 2022-07-27 阅读 73


如:setTimeout

setTimeout(function() {
this.$toast.show('请先下载支付宝App')
}, 3000)

应该写成

var self = this // 解决setTimeout不能直接使用this
setTimeout(function() {
self.$toast.show('请先下载支付宝App')
}, 3000)



举报

相关推荐

0 条评论