Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

238
Vistas
how stop animation when I leave page?
<template lang="pug">
.tasks
  h2
        .task(v-for='(task, index) in tasks' :key='task.index' :ref="`task${index}`" class="list-item" )
          .name(@click="taskModal(index)")
            | {{task.name}}
          .description(@click="taskModal(index)")
            | {{task.description1}}
          .time(@click="taskModal(index)")
            | {{task.time}}
          button(class='delete-task' @click="deleteCart(index)") -
</template>

<script lang="ts">
import { computed, defineComponent } from 'vue'
import { TaskInterface } from '@/types/task.interface'
import { useStore } from 'vuex'
export default defineComponent({
  setup () {
    const store = useStore()
    const tasks = computed(() => store.state.tasks)
    return {
      tasks
    }
  },
  data () {
    return {
      TaskStatusEnum,
      showModal: 'none',
      showDetailsModal: false,
      task: ''
    }
  },
  methods: {
    blink () {
      for (let i = 0; i < Object.values(this.$refs).length; i++) {
        setTimeout(() => {
          Object.values(this.$refs as unknown as HTMLElement)[i].classList.add('increase')
        }, 2000 * i)
        setTimeout(() => {
          Object.values(this.$refs as unknown as HTMLElement)[i].classList.remove('increase')
        }, 2000 * Object.values(this.$refs).length)
      }
    }
  },
  mounted () {
    this.blink()
  }
})
</script>

When I enter page my animation(blink) works good,but when i go to another page when animation work i have thih error in consoleenter image description here I think that i need to stop function but how can i do it? How can i stop this function when i leave page?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda