Здесь я настроил проект laravel 6 с помощью vue и vuetify для создания таблицы crud, но по какой-то причине я не могу импортировать vueX в мой vue компонент.
Ошибка :
ОШИБКА в ./resources/js/store/index.js Модуль не найден: Ошибка: не удается разрешить './stage.js' в 'c: \ WinNMP \ WWW\chillibiz \ resources \ js \ store '@ ./resources/js/store/index.js 3: 0-35 7: 11-16 @ ./resources/js/app.js @ multi ./resources/js/app.js ./resources/sass/app.scss
stage. js
export default {
state: {
stages: []
},
mutations: {
ADD_STAGE(state, stage) {
state.stages.push({
id: this.getters.newStageId,
code: stage.code,
name: stage.name,
description: stage.description
});
},
UPDATE_STAGE(state, payload){
state.stages = state.stages.map(stage => {
if (stage.id === payload.id) {
return Object.assign({}, stage, payload)
}
return stage;
})
},
REMOVE_STAGE(state, stage){
var stages = state.stages;
var id = stage.id;
var index = state.stages.findIndex(stage => stage.id == id)
stages.splice(index, 1);
},
},
actions: {
getStage({commit}, stage){
commit('GET_STAGE', stage)
},
addStage({commit}, stage){
commit('ADD_STAGE', stage)
},
updateStage({commit}, payload){
commit('UPDATE_STAGE', payload)
},
removeStage({commit}, stage){
commit('REMOVE_STAGE', stage)
},
},
getters: {
stages: state => state.stages,
newStageId(state) { return state.stages.length > 0 ? state.stages[state.stages.length-1].id + 1 : 1; },
}
}
index. js
import Vue from 'vue';
import Vuex from 'vuex';
import {stage} from './modules/stage.js';
Vue.use(Vuex);
export default new Vuex.Store({
modules: {
stage
},
state: {},
mutations: {},
actions: {}
});