showMessage上下文问题

This commit is contained in:
结发受长生 2019-09-07 23:14:16 +08:00
parent deaa767902
commit 8665aa0ad4

View File

@ -174,9 +174,10 @@ const vm = new Vue({
}).catch(err => { }).catch(err => {
console.warn('加载文章列表失败') console.warn('加载文章列表失败')
}) })
welcomeMessage().then((function(msg) { let _this = this
this.showMessage(msg, 6000) welcomeMessage().then(msg => {
}).bind(this)) _this.showMessage(msg, 6000)
})
document.addEventListener('copy', () => { document.addEventListener('copy', () => {
this.showMessage('你都复制了些什么呀,转载要记得加上出处哦') this.showMessage('你都复制了些什么呀,转载要记得加上出处哦')
}) })