2023-08-07 04:36:27 -04:00
|
|
|
|
|
|
|
// Vue 相关
|
2023-01-06 04:21:27 -05:00
|
|
|
import { createApp } from 'vue'
|
2019-12-19 06:17:21 -05:00
|
|
|
import App from './renderer/App.vue'
|
|
|
|
import router from './renderer/router'
|
2023-01-06 04:21:27 -05:00
|
|
|
import ElementUI from 'element-plus'
|
|
|
|
import 'element-plus/dist/index.css'
|
|
|
|
import VueLazyLoad from 'vue3-lazyload'
|
2023-08-07 04:36:27 -04:00
|
|
|
import vue3PhotoPreview from 'vue3-photo-preview'
|
|
|
|
import 'vue3-photo-preview/dist/index.css'
|
|
|
|
import VueVideoPlayer from '@videojs-player/vue'
|
|
|
|
|
|
|
|
// Electron 相关
|
|
|
|
import { webFrame } from 'electron'
|
|
|
|
|
|
|
|
// Axios
|
2019-12-26 07:15:41 -05:00
|
|
|
import axios from 'axios'
|
2023-08-07 04:36:27 -04:00
|
|
|
|
|
|
|
// Mixins
|
2023-01-06 04:21:27 -05:00
|
|
|
import { mainMixin } from './renderer/utils/mainMixin'
|
|
|
|
import { dragMixin } from '@/utils/mixin'
|
2023-08-07 04:36:27 -04:00
|
|
|
|
|
|
|
// 数据库
|
2021-07-25 11:25:36 -04:00
|
|
|
import db from './renderer/utils/db'
|
2023-08-07 04:36:27 -04:00
|
|
|
|
|
|
|
// 国际化
|
2022-08-20 04:44:55 -04:00
|
|
|
import { i18nManager, T } from './renderer/i18n/index'
|
2023-08-07 04:36:27 -04:00
|
|
|
|
|
|
|
// 工具函数
|
2023-01-06 04:21:27 -05:00
|
|
|
import { getConfig, saveConfig, sendToMain, triggerRPC } from '@/utils/dataSender'
|
2023-08-07 04:36:27 -04:00
|
|
|
|
|
|
|
// 状态管理
|
2023-01-06 04:21:27 -05:00
|
|
|
import { store } from '@/store'
|
2023-02-15 10:36:47 -05:00
|
|
|
import { createPinia } from 'pinia'
|
|
|
|
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
|
2023-08-07 04:36:27 -04:00
|
|
|
|
|
|
|
// 代码高亮
|
2023-02-21 05:42:50 -05:00
|
|
|
import 'highlight.js/styles/atom-one-dark.css'
|
|
|
|
import hljsVuePlugin from '@highlightjs/vue-plugin'
|
|
|
|
import hljsCommon from 'highlight.js/lib/common'
|
|
|
|
import 'video.js/dist/video-js.css'
|
2018-06-26 09:11:04 -04:00
|
|
|
|
2018-01-09 22:31:07 -05:00
|
|
|
webFrame.setVisualZoomLevelLimits(1, 1)
|
|
|
|
|
2023-01-06 04:21:27 -05:00
|
|
|
const app = createApp(App)
|
|
|
|
|
|
|
|
app.config.globalProperties.$builtInPicBed = [
|
2018-12-23 10:15:00 -05:00
|
|
|
'smms',
|
|
|
|
'imgur',
|
|
|
|
'qiniu',
|
|
|
|
'tcyun',
|
|
|
|
'upyun',
|
|
|
|
'aliyun',
|
2023-02-22 10:52:38 -05:00
|
|
|
'github',
|
2023-08-03 07:48:53 -04:00
|
|
|
'webdavplist',
|
2023-08-05 07:59:10 -04:00
|
|
|
'local',
|
|
|
|
'sftpplist'
|
2018-12-23 10:15:00 -05:00
|
|
|
]
|
2023-01-06 04:21:27 -05:00
|
|
|
|
|
|
|
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)
|
2023-02-15 10:36:47 -05:00
|
|
|
const pinia = createPinia()
|
|
|
|
pinia.use(piniaPluginPersistedstate)
|
2023-01-06 04:21:27 -05:00
|
|
|
|
|
|
|
app.use(VueLazyLoad, {
|
2022-12-30 22:29:36 -05:00
|
|
|
error: `file://${__static.replace(/\\/g, '/')}/unknown-file-type.svg`
|
|
|
|
})
|
2023-01-06 04:21:27 -05:00
|
|
|
app.use(ElementUI)
|
|
|
|
app.use(router)
|
|
|
|
app.use(store)
|
|
|
|
app.use(vue3PhotoPreview)
|
2023-02-15 10:36:47 -05:00
|
|
|
app.use(pinia)
|
2023-02-21 05:42:50 -05:00
|
|
|
console.log(hljsCommon.highlightAuto('<h1>Highlight.js has been registered successfully!</h1>').value)
|
|
|
|
app.use(hljsVuePlugin)
|
|
|
|
app.use(VueVideoPlayer)
|
2023-01-06 04:21:27 -05:00
|
|
|
app.mount('#app')
|