Answer the question
In order to leave comments, you need to log in
Is it possible to access the action in vuex not through assembly?
I implement vue into the finished site, for example, such a state
file is taken from the change
import Vue from 'vue'
const namespaced = true;
const state = todos;
const getters = {
search: state => state.search
}
const actions = {
clearSearch({commit}){
commit('CLEAR_SEARCH');
},
}
const mutations = {
CLEAR_SEARCH(state) {
state.search = []
}
}
export default {
namespaced,
state,
getters,
actions,
mutations
}
import store from './store';
...
window.store = store;
import Vue from 'vue'
import store from './store'
import FavoriteItem from './components/FavoriteItem'
...
let components = {
FavoriteItem
}
export {
Vue,
store,
components,
};
output: {
path: config.watch.assetsRoot,
filename: utils.assetsPath('js/[name].js'),
library: "build"
},
Answer the question
In order to leave comments, you need to log in
Make a public method and call. This is js - no matter how you do it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question