Vue 调用其他Vue或自己Vue中的方法时,this指向不生效

使用call来绑定,不行,因为Vue源码中对methods方法进行了遍历bind(fn),固定了this为当前实例

所以只能  实例.$options.methods.方法名.call(this)

posted @ 2021-04-22 10:22  otome  阅读(1097)  评论(0编辑  收藏  举报