如:在vue的methods中一个函数调用另外一个函数

this.$options.methods.函数名字();

(这样的话要注意,this的指向已经指向了这个实例而不是指向全局,所以可能会报错说bind没有函数绑定)
要this指向全局实例,要在后面加.bind(this) 如:this.$options.methods.函数名.bind(this)()

相关文章:

  • 2022-12-23
  • 2022-01-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-20
  • 2021-08-06
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-25
  • 2022-12-23
  • 2021-11-18
相关资源
相似解决方案