N
N
NikClik2019-01-16 11:23:13
JavaScript
NikClik, 2019-01-16 11:23:13

How to use vuex outside vue component?

How to correctly import storage into a js file that is not a component?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Danila, 2019-01-16
@NikClik

store.js export

const store = new Vuex.Store({
    ...
});

export default store;

store.js import
import store from './store.js';
store.dispatch('myAction');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question