feat: 新增加载动画
This commit is contained in:
@@ -172,7 +172,12 @@ class WindowService {
|
||||
width: size.width,
|
||||
height: size.height,
|
||||
});
|
||||
loadingView.webContents.loadFile(path.join(__dirname, 'loading.html'));
|
||||
|
||||
if (MAIN_WINDOW_VITE_DEV_SERVER_URL) {
|
||||
loadingView.webContents.loadURL(`${MAIN_WINDOW_VITE_DEV_SERVER_URL}/loading.html`);
|
||||
} else {
|
||||
loadingView.webContents.loadFile(path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/loading.html`));
|
||||
}
|
||||
|
||||
const onRendererIsReady = (e: IpcMainEvent) => {
|
||||
if ((e.sender !== window?.webContents) || rendererIsReady) return;
|
||||
@@ -208,7 +213,7 @@ class WindowService {
|
||||
if (MAIN_WINDOW_VITE_DEV_SERVER_URL) {
|
||||
return window.loadURL(`${MAIN_WINDOW_VITE_DEV_SERVER_URL}${'/html/' + (name === 'main' ? '' : name)}`);
|
||||
}
|
||||
window.loadFile(path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/html/${name === 'main' ? 'index' : name}.html`));
|
||||
window.loadFile(path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/html/${name === 'main' ? 'login' : name}.html`));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -22,12 +22,10 @@ const components: Plugin = (app) => {
|
||||
|
||||
// 创建 Vue 应用实例
|
||||
const app = createApp(App);
|
||||
const pinia = createPinia();
|
||||
|
||||
// 使用 Pinia 状态管理
|
||||
app.use(createPinia());
|
||||
|
||||
|
||||
// 使用 Vue Router
|
||||
app.use(pinia);
|
||||
app.use(router);
|
||||
app.use(ElementPlus, { locale })
|
||||
app.use(components)
|
||||
|
||||
@@ -19,7 +19,7 @@ const routes = [
|
||||
const router = createRouter({
|
||||
history: createMemoryHistory(),
|
||||
routes,
|
||||
scrollBehavior(to: any, from: any, savedPosition: any) {
|
||||
scrollBehavior(_to: any, _from: any, savedPosition: any) {
|
||||
if (savedPosition) {
|
||||
return savedPosition
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
import '@renderer/styles/index.css'
|
||||
|
||||
import errorHandler from '@utils/errorHandler'
|
||||
import i18n from '@renderer/i18n'
|
||||
import HeaderBar from '@renderer/components/HeaderBar/index.vue'
|
||||
import DragRegion from '@renderer/components/DragRegion/index.vue'
|
||||
|
||||
import Loading from './index.vue'
|
||||
|
||||
createApp(Loading)
|
||||
.use(i18n)
|
||||
.use(createPinia())
|
||||
.use(errorHandler)
|
||||
.component('HeaderBar', HeaderBar)
|
||||
.component('DragRegion', DragRegion)
|
||||
.mount('#app')
|
||||
@@ -1,5 +0,0 @@
|
||||
<template></template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user