ref 绑定dom节点,拿到的就是dom对象
ref 绑定组件,拿到的就是组件对象
使用案列:
<input type='text' ref='mytext'/>
<input type='password' ref='myPassword'/>
console.log(this.$refs.mytext) 此时获取到的是input中的value值
console.log(this.$refs.myPassword) 此时获取到的是password的值