Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

224
Views
How to trigger an animation on list change without v-for in vue?

I am trying to add animations to a tik tac toe game, where when an item in a list changes such as an X is added or an O is added an animation is played adding it.

This starts out as : list: ["", "", "", "", "", "", "", "", ""]

the code for the board is as follows:

<table>
            <tr>
              <td id="0" v-on:click="addX(0)">{{list[0]}}</td>
              <td id="1" class="vert" v-on:click="addX(1)">{{list[1]}}</td>
              <td id="2" v-on:click="addX(2)">{{list[2]}}</td>
            </tr>
            <tr>
              <td id="3" class="hori" v-on:click="addX(3)">{{list[3]}}</td>
              <td id="4" class="vert hori" v-on:click="addX(4)">{{list[4]}}</td>
              <td id="5" class="hori" v-on:click="addX(5)">{{list[5]}}</td>
            </tr>
            <tr>
              <td id="6" v-on:click="addX(6)">{{list[6]}}</td>
              <td id="7" class="vert" v-on:click="addX(7)">{{list[7]}}</td>
              <td id="8" v-on:click="addX(8)">{{list[8]}}</td>
            </tr>
</table> 

addX(num) is a function that adds an "X" to the num index in the list.

.hori and .vert are just classes to show the lines for the board.

I tried using

<transition-group
           name="custom-classes-transition"
           enter-active-class="animate__animated animate__bounceIn"
           leave-active-class="animate__animated animate__bounceOutRight"
           tag = "td" >

but it didn't work, no animation would play.

Many Thanks,

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!