This commit is contained in:
2025-09-25 15:31:11 +08:00
parent d18a3d5279
commit 972e76e655
11 changed files with 766 additions and 453 deletions

View File

@@ -1,8 +1,5 @@
import { appRegistry } from './AppRegistry'
import { markRaw } from 'vue'
import Calculator from './calculator/Calculator.vue'
import Notepad from './notepad/Notepad.vue'
import Todo from './todo/Todo.vue'
/**
* 注册所有内置应用
@@ -25,13 +22,17 @@ export function registerBuiltInApps() {
minHeight: 480,
resizable: true,
minimizable: true,
maximizable: false
maximizable: false,
},
category: 'utilities',
keywords: ['计算器', '数学', '运算', 'calculator', 'math']
keywords: ['计算器', '数学', '运算', 'calculator', 'math'],
},
component: markRaw(Calculator),
isBuiltIn: true
// 使用动态导入实现懒加载
component: async () => {
const { default: Calculator } = await import('./calculator/Calculator.vue')
return markRaw(Calculator)
},
isBuiltIn: true,
})
// 注册记事本应用
@@ -49,13 +50,17 @@ export function registerBuiltInApps() {
height: 600,
minWidth: 400,
minHeight: 300,
resizable: true
resizable: true,
},
category: 'productivity',
keywords: ['记事本', '文本编辑', '笔记', 'notepad', 'text', 'editor']
keywords: ['记事本', '文本编辑', '笔记', 'notepad', 'text', 'editor'],
},
component: markRaw(Notepad),
isBuiltIn: true
// 使用动态导入实现懒加载
component: async () => {
const { default: Notepad } = await import('./notepad/Notepad.vue')
return markRaw(Notepad)
},
isBuiltIn: true,
})
// 注册待办事项应用
@@ -73,13 +78,17 @@ export function registerBuiltInApps() {
height: 700,
minWidth: 400,
minHeight: 500,
resizable: true
resizable: true,
},
category: 'productivity',
keywords: ['待办事项', '任务管理', 'todo', 'task', 'productivity']
keywords: ['待办事项', '任务管理', 'todo', 'task', 'productivity'],
},
component: markRaw(Todo),
isBuiltIn: true
// 使用动态导入实现懒加载
component: async () => {
const { default: Todo } = await import('./todo/Todo.vue')
return markRaw(Todo)
},
isBuiltIn: true,
})
console.log('内置应用注册完成')
@@ -87,4 +96,4 @@ export function registerBuiltInApps() {
// 导出应用注册中心
export { appRegistry } from './AppRegistry'
export type { InternalAppManifest, AppRegistration } from './types/AppManifest'
export type { InternalAppManifest, AppRegistration } from './types/AppManifest'