A
A
asferot2019-03-14 10:55:02
Vue.js
asferot, 2019-03-14 10:55:02

How to make setTimeout for one block?

How to make setTimeout for one block? There is a block

tbody
            tr(v-for="zayavka in filterZayavka" :key="zayavka.id")
              td.block-data
                span.data {{zayavka.add_time | change_time}}
              td.block-filial
                span.filial {{zayavka.Filial}}
              td.block-manager
                span.manager {{zayavka.Manager}}

And it needs to be updated in real time. How can I do that?
I tried this but it doesn't seem right.
computed:{
    ...mapState(['zayavkas']),
    filterZayavka () {
      return this.$store.getters.filterZayavkas
   },
},
methods:{
    callFunction() {
            setTimeout(function () {
                this.filterZayavka
            }, 3000);
      }
},
mounted(){
    this.$store.dispatch('loadZayavka'),
    this.callFunction()
},

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Drozdov, 2019-03-14
@asferot

It seems to me that you did not understand the essence of reactivity)
There is no need to hang up timeouts, the store has been updated - the data has been updated in the block.
If you need the data to appear in 3 seconds, then you need to visit them in 3 seconds in the store.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question