我的github

意思是:在Vue所有的生命周期钩子方法(如created,mounted, updated以及destroyed)里使用this,this指向调用它的Vue实例,即(new Vue)。

那么哪个this是指向window窗口呢?

参考:https://blog.csdn.net/cddcj/article/details/80866902

          vue中的this指向问题:https://www.cnblogs.com/agen-su/p/9772080.html

 

打印this看一下

  initMeasure(){//mounted
        console.log(this);
  }

 

viewer仅仅是globe的容器,显示部分。与globe变量本身并不是一个东西

所以在子组件中创建的measure变量是在VueComponent上创建的

posted on 2021-11-22 11:00  XiaoNiuFeiTian  阅读(448)  评论(0)    收藏  举报