vue动态获取ref方式

2023年1月17日12:56:53

vue动态获取ref方式
vue动态获取ref方式

 <div v-for="(item,index) in list" :key="index"
             :class=" circleAnimation === 1 ? 'ball ball'+ (index+1) : 'ball ball1'+(index+1)" ref="circle" @click="oneClick(index)">
            <div>{{item.name}}</div>
        </div>

   oneClick(index) {
                if (index !== 2) {
                    this.circleAnimation = 1
                    const ref = this.$refs.circle[index].style
                }
            }

  • 作者:AAA_86
  • 原文链接:https://blog.csdn.net/weixin_46071217/article/details/123383353
    更新时间:2023年1月17日12:56:53 ,共 273 字。