mirror of
https://github.com/creativetimofficial/vue-material-kit.git
synced 2025-05-24 05:24:21 +08:00
27 lines
497 B
JavaScript
27 lines
497 B
JavaScript
import { defineStore } from "pinia";
|
|
import bootstrap from "bootstrap/dist/js/bootstrap.min.js";
|
|
|
|
export const useAppStore = defineStore("storeId", {
|
|
state: () => ({
|
|
bootstrap,
|
|
}),
|
|
});
|
|
|
|
|
|
export const useStore = defineStore({
|
|
id: 'main',
|
|
state: () => ({
|
|
isAuthenticated: false,
|
|
user: null,
|
|
}),
|
|
actions: {
|
|
login(user) {
|
|
this.isAuthenticated = true
|
|
this.user = user
|
|
},
|
|
logout() {
|
|
this.isAuthenticated = false
|
|
this.user = null
|
|
},
|
|
},
|
|
}) |