PicList/src/main.ts

60 lines
1.6 KiB
TypeScript
Raw Normal View History

import { createApp } from 'vue'
2019-12-19 06:17:21 -05:00
import App from './renderer/App.vue'
import router from './renderer/router'
import ElementUI from 'element-plus'
import 'element-plus/dist/index.css'
import { webFrame } from 'electron'
import VueLazyLoad from 'vue3-lazyload'
import axios from 'axios'
import { mainMixin } from './renderer/utils/mainMixin'
import { dragMixin } from '@/utils/mixin'
2021-04-10 09:01:55 -04:00
import { initTalkingData } from './renderer/utils/analytics'
import db from './renderer/utils/db'
2022-08-20 04:44:55 -04:00
import { i18nManager, T } from './renderer/i18n/index'
import { getConfig, saveConfig, sendToMain, triggerRPC } from '@/utils/dataSender'
import { store } from '@/store'
import vue3PhotoPreview from 'vue3-photo-preview'
import 'vue3-photo-preview/dist/index.css'
2018-06-26 09:11:04 -04:00
webFrame.setVisualZoomLevelLimits(1, 1)
2022-02-20 08:30:22 -05:00
// do here before vue init
2022-08-20 04:44:55 -04:00
// handleURLParams()
2022-02-20 08:30:22 -05:00
const app = createApp(App)
app.config.globalProperties.$builtInPicBed = [
2018-12-23 10:15:00 -05:00
'smms',
'imgur',
'qiniu',
'tcyun',
'upyun',
'aliyun',
'github'
]
2023-01-07 07:45:01 -05:00
app.config.unwrapInjectedRef = true
app.config.globalProperties.$$db = db
app.config.globalProperties.$http = axios
app.config.globalProperties.$T = T
app.config.globalProperties.$i18n = i18nManager
app.config.globalProperties.getConfig = getConfig
app.config.globalProperties.triggerRPC = triggerRPC
app.config.globalProperties.saveConfig = saveConfig
app.config.globalProperties.sendToMain = sendToMain
app.mixin(mainMixin)
app.mixin(dragMixin)
app.use(VueLazyLoad, {
error: `file://${__static.replace(/\\/g, '/')}/unknown-file-type.svg`
})
app.use(ElementUI)
app.use(router)
app.use(store)
app.use(vue3PhotoPreview)
2017-11-27 19:21:12 -05:00
app.mount('#app')
2021-04-10 09:01:55 -04:00
initTalkingData()