// 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, })