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,{
})
}
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,{
})