This commit is contained in:
ろむねこ 2024-07-18 16:48:22 +09:00
parent a2ce177757
commit efc6d8d593
Signed by: Fujimatsu
GPG Key ID: FA1F39A1BA37D168
3 changed files with 20 additions and 5 deletions

View File

@ -2,8 +2,16 @@
<router-view />
</template>
<script setup lang="ts">
defineOptions({
name: 'App'
<script lang="ts">
import { defineComponent } from 'vue';
import { useStore, Store } from 'vuex';
import { StateInterface } from './store';
export default defineComponent({
name: 'App',
setup() {
const store: Store<StateInterface> = useStore();
return { store };
},
});
</script>

View File

@ -16,8 +16,15 @@
</template>
<script setup lang="ts">
import { StoreInstance } from '@quasar/app-vite';
import { ref } from 'vue';
import EssentialLink, { EssentialLinkProps } from 'components/EssentialLink.vue';
import { storeKey, useStore } from 'vuex';
// AccountStateStoreisLoggedInfalse/login
const store = useStore<StoreInstance>(storeKey);
console.log(store.getters['AccountStateStore/isLoggedIn']);
defineOptions({
name: 'MainLayout'

View File

@ -17,7 +17,7 @@ declare module '@vue/runtime-core' {
}
// Provide typings for `useStore` helper
export const storeKey: InjectionKey<VuexStore<StateInterface>> = Symbol('vuex-key');
export const storeKey: InjectionKey<VuexStore<StateInterface>> = Symbol('account-state');
// Provide typings for `this.$router` inside Vuex stores
declare module 'vuex' {