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;