master
waqarulzafar 2023-02-09 23:07:01 +05:00
parent e654fa6ca8
commit 8f0fc39c60
1 changed files with 24 additions and 0 deletions

24
stores/user.js Normal file
View File

@ -0,0 +1,24 @@
// stores/counter.js
import { defineStore } from 'pinia'
export const useCounterStore = defineStore('user', {
state: () => {
return {
user:{},
is_login:false
}
},
// could also be defined as
// state: () => ({ count: 0 })
actions: {
login(user) {
this.user=user;
this.is_login=true;
},
logout(){
this.user={}
this.is_login=false;
}
},
persist: true,
})