项目中要在 watch中使用
r
e
f
s
操
作
d
o
m
对
象
,
因
为
我
们
的
w
a
t
c
h
是
监
听
特
性
,
会
使
用
时
,
t
h
i
s
.
refs 操作 dom对象, 因为我们的watch是监听特性, 会使用时, this.
refs操作dom对象,因为我们的watch是监听特性,会使用时,this.refs是undefined , 所以我们的解决办法是 this.$nextTick()来帮忙解决
这里解释了为什么 watch中无法得到 dom 对象的变化