first commit
This commit is contained in:
+51
@@ -0,0 +1,51 @@
|
||||
import { createApp } from 'vue'
|
||||
import { createPinia } from 'pinia'
|
||||
import { MutationCache, QueryCache, QueryClient, VueQueryPlugin } from '@tanstack/vue-query'
|
||||
import Vue3Toastify from 'vue3-toastify'
|
||||
|
||||
import App from '@/App.vue'
|
||||
import router from '@/router'
|
||||
import { globalComponents } from '@/utils/global-components'
|
||||
import { handleError } from '@/utils/error-handler'
|
||||
import { http } from '@/services/api'
|
||||
import { setupMocks } from '@/services/mock'
|
||||
|
||||
import 'vue3-toastify/dist/index.css'
|
||||
import '@/assets/main.scss'
|
||||
import '@/utils/yup-locale'
|
||||
|
||||
setupMocks(http)
|
||||
|
||||
const app = createApp(App)
|
||||
const pinia = createPinia()
|
||||
|
||||
Object.entries(globalComponents).forEach(([name, component]) => app.component(name, component))
|
||||
|
||||
const queryClient = new QueryClient({
|
||||
queryCache: new QueryCache({ onError: (error) => handleError(error) }),
|
||||
mutationCache: new MutationCache({ onError: (error) => handleError(error) }),
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
retry: false,
|
||||
staleTime: 5 * 60 * 1000,
|
||||
refetchInterval: false,
|
||||
refetchOnMount: false,
|
||||
refetchOnWindowFocus: false,
|
||||
gcTime: 5 * 60 * 1000,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
app.use(VueQueryPlugin, { queryClient })
|
||||
|
||||
app.use(Vue3Toastify, {
|
||||
theme: 'colored',
|
||||
type: 'default',
|
||||
position: 'bottom-right',
|
||||
autoClose: 1500,
|
||||
transition: 'slide',
|
||||
rtl: true,
|
||||
dangerouslyHTMLString: true,
|
||||
})
|
||||
|
||||
app.use(router).use(pinia).mount('#app')
|
||||
Reference in New Issue
Block a user