mirror of
https://github.com/directus/directus.git
synced 2026-01-27 07:08:17 -05:00
Provide stores / api
This commit is contained in:
@@ -30,14 +30,17 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, toRefs, watch, computed } from '@vue/composition-api';
|
||||
import { useAppStore, useUserStore, useSettingsStore } from '@/stores';
|
||||
import { defineComponent, toRefs, watch, computed, provide } from '@vue/composition-api';
|
||||
import * as stores from '@/stores';
|
||||
import api from '@/api';
|
||||
|
||||
import useWindowSize from '@/composables/use-window-size';
|
||||
import setFavicon from '@/utils/set-favicon';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const { useAppStore, useUserStore, useSettingsStore } = stores;
|
||||
|
||||
const appStore = useAppStore();
|
||||
const userStore = useUserStore();
|
||||
const settingsStore = useSettingsStore();
|
||||
@@ -98,6 +101,11 @@ export default defineComponent({
|
||||
|
||||
const error = computed(() => appStore.state.error);
|
||||
|
||||
provide('system', {
|
||||
...stores,
|
||||
api,
|
||||
});
|
||||
|
||||
return { hydrating, brandStyle, appAccess, error };
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user