一丶介绍
<div id="demo1" ref="demo2" >hello word</div>
this.$refs.demo2=document.getElementById('demo1');
this.$refs.demo2=document.querySelector('#demo1');
二丶扩展
this.$refs放在created里边会得到undefined;
this.$nextTick(()=>{
this.$refs.demo2
})
this.$nextTick()实时监听页面中dom完全渲染后才执行的