T
T
tehnazavr2018-02-16 05:17:49
Vue.js
tehnazavr, 2018-02-16 05:17:49

How to unsubmit a request every time an application tab is opened in vue js?

When you enter the tab, created is triggered, and a request is made to the api, the response is written to vuex. When I leave the tab and return, the request is sent again and again the record in the state. Therefore, the state is filled with duplicates of the first request.
It is necessary to make sure that the request is sent only the first time. Tried keep-alive , but nothing changed at all - no errors, nothing. So far, every time I overwrite the state, which is not good

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2018-02-16
@tehnazavr

check state before request?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question