Compare commits

...

4 Commits

Author SHA1 Message Date
a102395286 更新vite 2025-11-27 14:15:06 +08:00
81007cf938 修改组件逻辑+优化代码 2025-11-11 17:32:41 +08:00
f2bb7f3196 修改组件逻辑+优化代码 2025-11-11 17:20:43 +08:00
ce688a6834 保存 2025-10-24 11:07:27 +08:00
7 changed files with 1239 additions and 88 deletions

View File

@@ -35,7 +35,7 @@
"sass": "^1.90.0",
"typescript": "~5.8.0",
"unocss": "^66.4.2",
"vite": "^7.0.6",
"vite": "^7.2.4",
"vite-plugin-vue-devtools": "^8.0.0",
"vue-tsc": "^3.0.4"
}

104
pnpm-lock.yaml generated
View File

@@ -38,10 +38,10 @@ importers:
version: 22.17.1
'@vitejs/plugin-vue':
specifier: ^6.0.1
version: 6.0.1(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))(vue@3.5.18(typescript@5.8.3))
version: 6.0.1(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))(vue@3.5.18(typescript@5.8.3))
'@vitejs/plugin-vue-jsx':
specifier: ^5.0.1
version: 5.0.1(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))(vue@3.5.18(typescript@5.8.3))
version: 5.0.1(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))(vue@3.5.18(typescript@5.8.3))
'@vue/tsconfig':
specifier: ^0.7.0
version: 0.7.0(typescript@5.8.3)(vue@3.5.18(typescript@5.8.3))
@@ -62,13 +62,13 @@ importers:
version: 5.8.3
unocss:
specifier: ^66.4.2
version: 66.4.2(postcss@8.5.6)(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))
version: 66.4.2(postcss@8.5.6)(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))
vite:
specifier: ^7.0.6
version: 7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
specifier: ^7.2.4
version: 7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
vite-plugin-vue-devtools:
specifier: ^8.0.0
version: 8.0.0(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))(vue@3.5.18(typescript@5.8.3))
version: 8.0.0(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))(vue@3.5.18(typescript@5.8.3))
vue-tsc:
specifier: ^3.0.4
version: 3.0.5(typescript@5.8.3)
@@ -1054,6 +1054,15 @@ packages:
picomatch:
optional: true
fdir@6.5.0:
resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==}
engines: {node: '>=12.0.0'}
peerDependencies:
picomatch: ^3 || ^4
peerDependenciesMeta:
picomatch:
optional: true
figures@6.1.0:
resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==}
engines: {node: '>=18'}
@@ -1435,6 +1444,10 @@ packages:
resolution: {integrity: sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==}
engines: {node: '>=12.0.0'}
tinyglobby@0.2.15:
resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==}
engines: {node: '>=12.0.0'}
to-regex-range@5.0.1:
resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
engines: {node: '>=8.0'}
@@ -1526,8 +1539,8 @@ packages:
peerDependencies:
vite: ^3.0.0-0 || ^4.0.0-0 || ^5.0.0-0 || ^6.0.0-0 || ^7.0.0-0
vite@7.1.1:
resolution: {integrity: sha512-yJ+Mp7OyV+4S+afWo+QyoL9jFWD11QFH0i5i7JypnfTcA1rmgxCbiA8WwAICDEtZ1Z1hzrVhN8R8rGTqkTY8ZQ==}
vite@7.2.4:
resolution: {integrity: sha512-NL8jTlbo0Tn4dUEXEsUg8KeyG/Lkmc4Fnzb8JXN/Ykm9G4HNImjtABMJgkQoVjOBN/j2WAwDTRytdqJbZsah7w==}
engines: {node: ^20.19.0 || >=22.12.0}
hasBin: true
peerDependencies:
@@ -2102,13 +2115,13 @@ snapshots:
'@types/web-bluetooth@0.0.21': {}
'@unocss/astro@66.4.2(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))':
'@unocss/astro@66.4.2(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))':
dependencies:
'@unocss/core': 66.4.2
'@unocss/reset': 66.4.2
'@unocss/vite': 66.4.2(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))
'@unocss/vite': 66.4.2(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))
optionalDependencies:
vite: 7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
vite: 7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
'@unocss/cli@66.4.2':
dependencies:
@@ -2239,7 +2252,7 @@ snapshots:
dependencies:
'@unocss/core': 66.4.2
'@unocss/vite@66.4.2(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))':
'@unocss/vite@66.4.2(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))':
dependencies:
'@ampproject/remapping': 2.3.0
'@unocss/config': 66.4.2
@@ -2250,23 +2263,23 @@ snapshots:
pathe: 2.0.3
tinyglobby: 0.2.14
unplugin-utils: 0.2.5
vite: 7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
vite: 7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
'@vitejs/plugin-vue-jsx@5.0.1(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))(vue@3.5.18(typescript@5.8.3))':
'@vitejs/plugin-vue-jsx@5.0.1(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))(vue@3.5.18(typescript@5.8.3))':
dependencies:
'@babel/core': 7.28.0
'@babel/plugin-transform-typescript': 7.28.0(@babel/core@7.28.0)
'@rolldown/pluginutils': 1.0.0-beta.31
'@vue/babel-plugin-jsx': 1.5.0(@babel/core@7.28.0)
vite: 7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
vite: 7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
vue: 3.5.18(typescript@5.8.3)
transitivePeerDependencies:
- supports-color
'@vitejs/plugin-vue@6.0.1(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))(vue@3.5.18(typescript@5.8.3))':
'@vitejs/plugin-vue@6.0.1(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))(vue@3.5.18(typescript@5.8.3))':
dependencies:
'@rolldown/pluginutils': 1.0.0-beta.29
vite: 7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
vite: 7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
vue: 3.5.18(typescript@5.8.3)
'@volar/language-core@2.4.22':
@@ -2349,14 +2362,14 @@ snapshots:
dependencies:
'@vue/devtools-kit': 7.7.7
'@vue/devtools-core@8.0.0(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))(vue@3.5.18(typescript@5.8.3))':
'@vue/devtools-core@8.0.0(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))(vue@3.5.18(typescript@5.8.3))':
dependencies:
'@vue/devtools-kit': 8.0.0
'@vue/devtools-shared': 8.0.0
mitt: 3.0.1
nanoid: 5.1.5
pathe: 2.0.3
vite-hot-client: 2.1.0(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))
vite-hot-client: 2.1.0(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))
vue: 3.5.18(typescript@5.8.3)
transitivePeerDependencies:
- vite
@@ -2624,6 +2637,10 @@ snapshots:
optionalDependencies:
picomatch: 4.0.3
fdir@6.5.0(picomatch@4.0.3):
optionalDependencies:
picomatch: 4.0.3
figures@6.1.0:
dependencies:
is-unicode-supported: 2.1.0
@@ -2977,6 +2994,11 @@ snapshots:
fdir: 6.4.6(picomatch@4.0.3)
picomatch: 4.0.3
tinyglobby@0.2.15:
dependencies:
fdir: 6.5.0(picomatch@4.0.3)
picomatch: 4.0.3
to-regex-range@5.0.1:
dependencies:
is-number: 7.0.0
@@ -3000,9 +3022,9 @@ snapshots:
unicorn-magic@0.3.0: {}
unocss@66.4.2(postcss@8.5.6)(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)):
unocss@66.4.2(postcss@8.5.6)(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)):
dependencies:
'@unocss/astro': 66.4.2(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))
'@unocss/astro': 66.4.2(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))
'@unocss/cli': 66.4.2
'@unocss/core': 66.4.2
'@unocss/postcss': 66.4.2(postcss@8.5.6)
@@ -3020,9 +3042,9 @@ snapshots:
'@unocss/transformer-compile-class': 66.4.2
'@unocss/transformer-directives': 66.4.2
'@unocss/transformer-variant-group': 66.4.2
'@unocss/vite': 66.4.2(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))
'@unocss/vite': 66.4.2(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))
optionalDependencies:
vite: 7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
vite: 7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
transitivePeerDependencies:
- postcss
- supports-color
@@ -3045,17 +3067,17 @@ snapshots:
evtd: 0.2.4
vue: 3.5.18(typescript@5.8.3)
vite-dev-rpc@1.1.0(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)):
vite-dev-rpc@1.1.0(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)):
dependencies:
birpc: 2.5.0
vite: 7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
vite-hot-client: 2.1.0(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))
vite: 7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
vite-hot-client: 2.1.0(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))
vite-hot-client@2.1.0(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)):
vite-hot-client@2.1.0(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)):
dependencies:
vite: 7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
vite: 7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
vite-plugin-inspect@11.3.2(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)):
vite-plugin-inspect@11.3.2(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)):
dependencies:
ansis: 4.1.0
debug: 4.4.1
@@ -3065,27 +3087,27 @@ snapshots:
perfect-debounce: 1.0.0
sirv: 3.0.1
unplugin-utils: 0.2.5
vite: 7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
vite-dev-rpc: 1.1.0(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))
vite: 7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
vite-dev-rpc: 1.1.0(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))
transitivePeerDependencies:
- supports-color
vite-plugin-vue-devtools@8.0.0(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))(vue@3.5.18(typescript@5.8.3)):
vite-plugin-vue-devtools@8.0.0(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))(vue@3.5.18(typescript@5.8.3)):
dependencies:
'@vue/devtools-core': 8.0.0(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))(vue@3.5.18(typescript@5.8.3))
'@vue/devtools-core': 8.0.0(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))(vue@3.5.18(typescript@5.8.3))
'@vue/devtools-kit': 8.0.0
'@vue/devtools-shared': 8.0.0
execa: 9.6.0
sirv: 3.0.1
vite: 7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
vite-plugin-inspect: 11.3.2(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))
vite-plugin-vue-inspector: 5.3.2(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))
vite: 7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
vite-plugin-inspect: 11.3.2(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))
vite-plugin-vue-inspector: 5.3.2(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0))
transitivePeerDependencies:
- '@nuxt/kit'
- supports-color
- vue
vite-plugin-vue-inspector@5.3.2(vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)):
vite-plugin-vue-inspector@5.3.2(vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)):
dependencies:
'@babel/core': 7.28.0
'@babel/plugin-proposal-decorators': 7.28.0(@babel/core@7.28.0)
@@ -3096,18 +3118,18 @@ snapshots:
'@vue/compiler-dom': 3.5.18
kolorist: 1.8.0
magic-string: 0.30.17
vite: 7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
vite: 7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0)
transitivePeerDependencies:
- supports-color
vite@7.1.1(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0):
vite@7.2.4(@types/node@22.17.1)(jiti@2.5.1)(sass@1.90.0):
dependencies:
esbuild: 0.25.8
fdir: 6.4.6(picomatch@4.0.3)
fdir: 6.5.0(picomatch@4.0.3)
picomatch: 4.0.3
postcss: 8.5.6
rollup: 4.46.2
tinyglobby: 0.2.14
tinyglobby: 0.2.15
optionalDependencies:
'@types/node': 22.17.1
fsevents: 2.3.3

View File

@@ -45,7 +45,7 @@ body {
background-color: var(--color-light);
-webkit-font-smoothing: antialiased; /* 字体抗锯齿 */
text-rendering: optimizeLegibility;
overflow-x: hidden;
overflow: hidden;
}
/* ===== 排版元素 ===== */

View File

@@ -1,6 +1,7 @@
import type { IEventBuilder } from '@/events/IEventBuilder'
import type { IWindowFormEvents, IWindowFormInstance } from './WindowFormDataManager.ts'
import { safeSubscribe } from '@/services/windowForm/utils.ts'
import '@/ui/webComponents/WindowFormElement.ts'
/**
* WindowFormRenderer
@@ -8,54 +9,32 @@ import { safeSubscribe } from '@/services/windowForm/utils.ts'
* 负责窗口的DOM创建、销毁与视觉状态更新。
*/
export class WindowFormRenderer {
private eventBus: IEventBuilder<IWindowFormEvents>
private wfEventBus: IEventBuilder<IWindowFormEvents>
constructor(eventBus: IEventBuilder<IWindowFormEvents>) {
this.eventBus = eventBus
constructor(wfEventBus: IEventBuilder<IWindowFormEvents>) {
this.wfEventBus = wfEventBus
}
/** 创建窗口DOM结构 */
async createWindowElement(win: IWindowFormInstance) {
const el = document.createElement('div')
el.className = 'system-window'
el.dataset.id = win.id
el.style.cssText = `
position:absolute;
width:${win.config.width}px;
height:${win.config.height}px;
left:${win.config.x ?? 200}px;
top:${win.config.y ?? 150}px;
background:#fff;
border-radius:8px;
border:1px solid #ccc;
box-shadow:0 4px 20px rgba(0,0,0,.15);
overflow:hidden;
transition:all .15s ease;
`
// 标题栏
const titleBar = this.createTitleBar(win)
const content = document.createElement('div')
content.className = 'window-content'
content.style.cssText = `width:100%;height:calc(100% - 40px);overflow:hidden;`
content.innerHTML = `<div class="loading-state">加载中...</div>`
el.append(titleBar, content)
document.body.appendChild(el)
const el = document.createElement('window-form-element')
el.wfData = win
win.element = el
document.body.appendChild(el)
// 生命周期UI响应
safeSubscribe(win, this.eventBus, 'onLoadStart', id => {
if (id === win.id) this.showLoading(win)
})
safeSubscribe(win, this.eventBus, 'onLoaded', id => {
if (id === win.id) this.hideLoading(win)
})
safeSubscribe(win, this.eventBus, 'onError', (id, err) => {
if (id === win.id) this.showError(win, err)
})
safeSubscribe(win, this.eventBus, 'onDestroy', id => {
if (id === win.id) this.destroy(win)
})
// // 生命周期UI响应
// safeSubscribe(win, this.eventBus, 'onLoadStart', id => {
// if (id === win.id) this.showLoading(win)
// })
// safeSubscribe(win, this.eventBus, 'onLoaded', id => {
// if (id === win.id) this.hideLoading(win)
// })
// safeSubscribe(win, this.eventBus, 'onError', (id, err) => {
// if (id === win.id) this.showError(win, err)
// })
// safeSubscribe(win, this.eventBus, 'onDestroy', id => {
// if (id === win.id) this.destroy(win)
// })
}
/** 创建标题栏 */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,101 @@
*,
*::before,
*::after {
box-sizing: border-box; /* 使用更直观的盒模型 */
margin: 0;
padding: 0;
}
:host {
position: absolute;
top: 0;
left: 0;
display: block;
z-index: 10;
user-select: none;
--titlebar-height: 32px;
--shadow: 0 10px 30px rgba(0,0,0,0.25);
font-family: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}
:host([focused]) {
z-index: 11;
.window {
border-color: #8338ec;
}
}
:host([windowFormState='maximized']) {
.window {
border-radius: 0;
box-shadow: none;
}
}
.window {
position: absolute;
box-shadow: var(--shadow, 0 10px 30px rgba(0,0,0,0.25));
background: linear-gradient(#ffffff, #f6f6f6);
border: 1px solid rgba(0,0,0,0.08);
border-radius: 6px;
overflow: hidden;
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
&.focus {
border-color: #3a86ff;
}
}
.titlebar {
height: var(--titlebar-height);
display: flex;
align-items: center;
padding: 0 8px;
gap: 8px;
background: linear-gradient(#f2f2f2, #e9e9e9);
border-bottom: 1px solid rgba(0,0,0,0.06);
.title {
font-size: 13px;
font-weight: 600;
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #111;
}
.controls {
display: flex; gap: 6px;
button.ctrl {
width: 34px;
height: 24px;
border: none;
background: transparent;
border-radius: 4px;
cursor: pointer;
font-weight: 600;
font-size: 12px;
&:hover {
background: rgba(0,0,0,0.06);
}
}
}
}
.content { flex: 1; overflow: auto; padding: 12px; background: transparent; }
.resizer { position: absolute; z-index: 20; }
.resizer.t { height: 6px; left: 0; right: 0; top: -3px; cursor: ns-resize; }
.resizer.b { height: 6px; left: 0; right: 0; bottom: -3px; cursor: ns-resize; }
.resizer.r { width: 6px; top: 0; bottom: 0; right: -3px; cursor: ew-resize; }
.resizer.l { width: 6px; top: 0; bottom: 0; left: -3px; cursor: ew-resize; }
.resizer.tr { width: 12px; height: 12px; right: -6px; top: -6px; cursor: nesw-resize; }
.resizer.tl { width: 12px; height: 12px; left: -6px; top: -6px; cursor: nwse-resize; }
.resizer.br { width: 12px; height: 12px; right: -6px; bottom: -6px; cursor: nwse-resize; }
.resizer.bl { width: 12px; height: 12px; left: -6px; bottom: -6px; cursor: nesw-resize; }

View File

@@ -13,7 +13,7 @@ export default defineConfig({
vue({
template: {
compilerOptions: {
isCustomElement: tag => tag.endsWith('-element') // 忽略自定义元素
isCustomElement: (tag) => tag.endsWith('-element') // 忽略自定义元素
}
}
}),
@@ -24,7 +24,7 @@ export default defineConfig({
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'vue': 'vue/dist/vue.esm-bundler.js'
vue: 'vue/dist/vue.esm-bundler.js'
}
},
build: {
@@ -33,7 +33,7 @@ export default defineConfig({
// 配置代码分割
manualChunks: {
// 将Vue相关库打包到单独的chunk中
vue: ['vue', 'vue-router', 'pinia'],
vue: ['vue', 'pinia'],
// 将UI库打包到单独的chunk中
ui: ['naive-ui'],
// 将工具库打包到单独的chunk中