作用:获取dom更新
基本操作:
<button id="firstBtn" @click="testClick()" ref="button">{{msg}}</button>
methods:{
testClick:()=>{
this.msg="修改后的值";
//that.$refs.button获取指定DOM
console.log(that.$refs.button.innerText); //输出原始值
this.$nextTick(()=>{
console.log(that.$refs.button.innerText); //修改后的值
}
}