Uncaught TypeError: Cannot set property 'wrapper' of null Do you know why?

Uncaught TypeError: Cannot set property 'wrapper' of null

<template>
<div class="wrapper" ref="wrapper">
  <div class="content"></div>
  <slot></slot>
</div>  
</template>


  mounted(){
    this.scroll=new BScroll(this.$refs.wrapper,{

    })
  }


可能是this的指向问题,你试一下:

let that=this;
this.scroll=new BScroll(that.$refs.wrapper,{

})

应该就是this指向问题,New的做的事情:
1.创建一个新对象
2.将新对象的_proto_指向构造函数的prototype对象
3.将构造函数的作用域赋值给新对象 (也就是this指向新对象)
4.执行构造函数中的代码(为这个新对象添加属性)
5.返回新的对象
new会改变this指向