Version 1.0.0 - Initialisation du depot

This commit is contained in:
2025-07-25 18:00:14 +02:00
commit e3d7a911f4
51 changed files with 4335 additions and 0 deletions

30
src/stores/userStore.js Normal file
View File

@@ -0,0 +1,30 @@
import { defineStore } from 'pinia';
import { ref, watch } from 'vue';
export const useUserStore = defineStore('user', () => {
const userInfo = ref(null);
watch(userInfo, (newValue) => {
if (newValue) {
localStorage.setItem('userInfo', JSON.stringify(newValue));
} else {
localStorage.removeItem('userInfo');
}
});
function setUserInfo(newUserInfo) {
console.log("Setting new user info");
userInfo.value = newUserInfo;
}
function clearUserInfo() {
console.log("Clearing user info");
userInfo.value = null;
}
return {
userInfo,
setUserInfo,
clearUserInfo,
};
})