chore
This commit is contained in:
38
src/App.vue
38
src/App.vue
@@ -1,35 +1,24 @@
|
||||
<script lang="ts">
|
||||
const GlobalFeedback = defineComponent({
|
||||
setup() {
|
||||
window.$dialog = useDialog()
|
||||
window.$loadingBar = useLoadingBar()
|
||||
window.$message = useMessage()
|
||||
window.$notification = useNotification()
|
||||
return () => null
|
||||
window.$dialog = useDialog();
|
||||
window.$loadingBar = useLoadingBar();
|
||||
window.$message = useMessage();
|
||||
window.$notification = useNotification();
|
||||
return () => null;
|
||||
},
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
dateZhCN,
|
||||
NConfigProvider,
|
||||
NDialogProvider,
|
||||
NLoadingBarProvider,
|
||||
NMessageProvider,
|
||||
NNotificationProvider,
|
||||
useDialog,
|
||||
useLoadingBar,
|
||||
useMessage,
|
||||
useNotification,
|
||||
zhCN,
|
||||
} from 'naive-ui'
|
||||
import { defineComponent } from 'vue'
|
||||
import { useThemeStore } from '@/stores/theme'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { dateZhCN, NConfigProvider, NDialogProvider, NLoadingBarProvider, NMessageProvider, NNotificationProvider, useDialog, useLoadingBar, useMessage, useNotification, zhCN } from 'naive-ui';
|
||||
import { defineComponent } from 'vue';
|
||||
import { useThemeStore } from '@/stores/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { VueQueryDevtools } from '@tanstack/vue-query-devtools';
|
||||
|
||||
const themeStore = useThemeStore()
|
||||
const { themeMode } = storeToRefs(themeStore)
|
||||
const themeStore = useThemeStore();
|
||||
const { themeMode } = storeToRefs(themeStore);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -40,6 +29,7 @@ const { themeMode } = storeToRefs(themeStore)
|
||||
<NNotificationProvider>
|
||||
<GlobalFeedback />
|
||||
<RouterView />
|
||||
<VueQueryDevtools />
|
||||
</NNotificationProvider>
|
||||
</NMessageProvider>
|
||||
</NLoadingBarProvider>
|
||||
|
||||
15
src/main.ts
15
src/main.ts
@@ -1,15 +1,30 @@
|
||||
import { createApp } from 'vue'
|
||||
import { createPinia } from 'pinia'
|
||||
import persist from 'pinia-plugin-persistedstate'
|
||||
import { VueQueryPlugin, QueryClient } from '@tanstack/vue-query'
|
||||
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
|
||||
import '@/styles/reset.scss'
|
||||
|
||||
import { getAppEnvConfig } from '@/utils/env'
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
refetchInterval: getAppEnvConfig().requestInterval * 1000,
|
||||
refetchIntervalInBackground: false,
|
||||
refetchOnReconnect: true,
|
||||
refetchOnWindowFocus: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
app.use(createPinia().use(persist))
|
||||
app.use(router)
|
||||
app.use(VueQueryPlugin, { queryClient })
|
||||
|
||||
app.mount('#app')
|
||||
|
||||
Reference in New Issue
Block a user