xyyd-fatfox/src/main.ts

29 lines
912 B
TypeScript
Raw Normal View History

2024-09-09 17:53:07 +08:00
import './main.css'
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import persist from 'pinia-plugin-persistedstate'
import App from './App.vue'
import getFp from './utils/getFp'
import vOutsideClick from './utils/vOutsideClick'
import dayjs from 'dayjs'
2024-11-04 19:30:31 +08:00
2024-09-18 16:27:43 +08:00
import Toast, { useToast, type PluginOptions } from 'vue-toastification'
2024-10-15 16:25:01 +08:00
import customParseFormat from 'dayjs/plugin/customParseFormat'
2024-09-18 16:27:43 +08:00
import 'vue-toastification/dist/index.css'
2024-09-09 17:53:07 +08:00
import 'dayjs/locale/zh-cn'
dayjs.locale('zh-cn')
const app = createApp(App)
2024-09-18 16:27:43 +08:00
export const globalToast = useToast()
2024-10-15 16:25:01 +08:00
dayjs.extend(customParseFormat)
2024-09-09 17:53:07 +08:00
// ! persist 利用 localstorage请不要在大量数据时使用
// 大量数据(扩张内容,文件),清直接使用 ./db.ts
app.use(createPinia().use(persist))
2024-09-18 16:27:43 +08:00
app.use(Toast)
2024-09-09 17:53:07 +08:00
app.directive('outside-click', vOutsideClick)
getFp().then((fp) => {
console.info('fp:', fp)
app.mount('#app')
})