父访问子 ref

110 阅读1分钟

ref作用:拿到子组件里面的数据

1给组件标签设置一个ref = "scroll"

updated(){

console.log(this.$refs.scroll); //这样就可以拿到子组件的对象

//查看你要操作的属性

}