forked from trent_larson/crowd-funder-for-time-pwa
Added Pinia in addition to Vuex for state-management. Will migrate to Pinia eventually
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { createPinia } from "pinia";
|
||||
import { createApp } from "vue";
|
||||
import App from "./App.vue";
|
||||
import "./registerServiceWorker";
|
||||
@@ -50,5 +51,6 @@ import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
|
||||
createApp(App)
|
||||
.component("fa", FontAwesomeIcon)
|
||||
.use(store)
|
||||
.use(createPinia())
|
||||
.use(router)
|
||||
.mount("#app");
|
||||
|
||||
19
src/store/account.ts
Normal file
19
src/store/account.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
// @ts-check
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
export const useAccountStore = defineStore({
|
||||
id: "account",
|
||||
state: () => ({
|
||||
firstName: "",
|
||||
lastName: "",
|
||||
}),
|
||||
|
||||
actions: {
|
||||
reset() {
|
||||
this.$patch({
|
||||
firstName: "",
|
||||
lastName: "",
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user