举个栗子:
<div :ref="'hhh'+one" @click="tryref">hhhhhhhh</div>
one是动态的值。
代码实现:
tryref(){
this.$refs[`hhh${this.one}`];
console.log(this.$refs[`hhh${this.one}`])
}
举个栗子:
<div :ref="'hhh'+one" @click="tryref">hhhhhhhh</div>
one是动态的值。
代码实现:
tryref(){
this.$refs[`hhh${this.one}`];
console.log(this.$refs[`hhh${this.one}`])
}