Answer the question
In order to leave comments, you need to log in
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}}
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
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 questionAsk a Question
731 491 924 answers to any question