2023-09-15 10:53:23 +08:00
|
|
|
import { createApp } from 'vue'
|
2023-10-23 18:14:41 +08:00
|
|
|
import { createI18n } from 'vue-i18n'
|
|
|
|
import messages from '@intlify/unplugin-vue-i18n/messages'
|
2023-09-15 10:53:23 +08:00
|
|
|
import App from './App.vue'
|
|
|
|
|
2023-10-12 17:35:27 +08:00
|
|
|
import store from './store/index.js'
|
|
|
|
|
2023-09-15 19:32:13 +08:00
|
|
|
import plugins from './plugins/index.js'
|
2023-10-17 17:54:29 +08:00
|
|
|
import icons from './icons/index.js'
|
2023-09-15 19:32:13 +08:00
|
|
|
|
2023-10-20 14:23:48 +08:00
|
|
|
import { replaceIP } from '@/utils/index.js'
|
|
|
|
|
2023-09-15 19:32:13 +08:00
|
|
|
import 'virtual:uno.css'
|
|
|
|
import './styles/index.js'
|
|
|
|
|
|
|
|
const app = createApp(App)
|
|
|
|
|
2023-10-12 17:35:27 +08:00
|
|
|
app.use(store)
|
|
|
|
|
2023-09-15 19:32:13 +08:00
|
|
|
app.use(plugins)
|
2023-10-23 18:14:41 +08:00
|
|
|
|
2023-10-17 17:54:29 +08:00
|
|
|
app.use(icons)
|
2023-09-15 19:32:13 +08:00
|
|
|
|
2023-10-23 18:14:41 +08:00
|
|
|
const locale = window.electron?.process?.env?.LOCALE
|
|
|
|
// const locale = 'en_US'
|
|
|
|
// console.log('locale', locale)
|
|
|
|
const i18n = createI18n({
|
|
|
|
locale,
|
|
|
|
messages,
|
|
|
|
})
|
|
|
|
app.use(i18n)
|
|
|
|
|
2023-09-16 18:04:14 +08:00
|
|
|
app.config.globalProperties.$electron = window.electron
|
2023-09-18 15:07:28 +08:00
|
|
|
app.config.globalProperties.$adb = window.adbkit
|
|
|
|
app.config.globalProperties.$scrcpy = window.scrcpy
|
2023-10-12 17:35:27 +08:00
|
|
|
app.config.globalProperties.$path = window.nodePath
|
2023-10-18 19:23:00 +08:00
|
|
|
app.config.globalProperties.$appStore = window.appStore
|
2023-09-15 19:32:13 +08:00
|
|
|
|
2023-10-20 14:23:48 +08:00
|
|
|
app.config.globalProperties.$replaceIP = replaceIP
|
|
|
|
|
2023-10-20 18:17:58 +08:00
|
|
|
console.log('electron', window.electron)
|
|
|
|
|
2023-10-16 17:36:13 +08:00
|
|
|
app.mount('#app').$nextTick(() => {
|
2023-10-16 11:53:08 +08:00
|
|
|
// Remove Preload scripts loading
|
|
|
|
postMessage({ payload: 'removeLoading' }, '*')
|
|
|
|
})
|