-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Description
// Vue version 2.6.10
var app = new Vue({
data() {
return {
name: 'vueThis'
}
},
created() {
this.$nextTick(say)
this.test(say, objThis)
this.$nextTick(function () {
console.log(this, 'this')
this.text() // can not find text
}, {
text(){
console.log('test')
}
})
},
methods: {
test(cb, ctx) {
const fn = () => {
cb.call(ctx)
}
fn()
},
say() {
console.log(this)
console.log(this.name)
}
}
})
this.$nextTick(function () {
console.log(this, 'this')
this.text() // can not find text
})
Metadata
Metadata
Assignees
Labels
No labels