1、簡單賦值
<div ref="refCon"></div>
訪問方式:
this.$refs.refCon
2、循環賦值,相同名稱
<div v-for="i in 2" ref="refCon"></div>
訪問方式:
this.$refs.refCon[0]
this.$refs.refCon[1]
3、循環賦值,不同名稱
<div v-for="i in 2" :ref="`refCon${i}`"></div>
訪問方式:
this.$refs.refCon0[0]
this.$refs.refCon1[0]