first commit

This commit is contained in:
Sas Andy
2024-08-12 08:42:51 +07:00
parent 6deeec116e
commit 2051b6439d
82 changed files with 78274 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
// src/store/moduleA.js
const moduleA = {
namespaced: true,
state() {
return {
count: 0,
data: null
};
},
mutations: {
increment(state) {
state.count++;
},
decrement(state) {
state.count--;
},
setData(state, payload) {
state.data = payload;
}
},
actions: {
async login({ state, commit }) {
const params = {
email: state.email,
password: state.password
};
try {
const response = await axios.post(URL + '/login', params);
commit('setData', response.data);
} catch (error) {
console.error('Error:', error);
}
}
}
};
// Export moduleA as a global variable
window.moduleA = moduleA;

View File

@@ -0,0 +1,26 @@
// src/store/moduleB.js
const moduleB = {
namespaced: true,
state() {
return {
email: 'example@example.com',
password: null,
dialog_success: false
};
},
mutations: {
setEmail(state, data) {
state.email = data;
},
setPassword(state, data) {
state.password = data;
},
setDialogSuccess(state, data) {
state.dialog_success = data;
}
}
};
// Export moduleB as a global variable
window.moduleB = moduleB;

View File

@@ -0,0 +1,9 @@
const store = new Vuex.Store({
modules: {
moduleA: window.moduleA,
moduleB: window.moduleB
}
});
// Export store
window.store = store;