mirror of
https://github.com/r-ca/kidshift-web.git
synced 2024-10-26 00:34:01 +00:00
wip
This commit is contained in:
parent
a2ce177757
commit
efc6d8d593
14
src/App.vue
14
src/App.vue
|
@ -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>
|
||||
|
|
|
@ -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';
|
||||
|
||||
// AccountStateStoreのisLoggedInがfalseなら/loginにリダイレクト
|
||||
|
||||
const store = useStore<StoreInstance>(storeKey);
|
||||
|
||||
console.log(store.getters['AccountStateStore/isLoggedIn']);
|
||||
|
||||
defineOptions({
|
||||
name: 'MainLayout'
|
||||
|
|
|
@ -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' {
|
||||
|
|
Loading…
Reference in New Issue
Block a user