feat: 新增知识库页面
This commit is contained in:
16
html/knowledge.html
Normal file
16
html/knowledge.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>NIANXX</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta
|
||||
http-equiv="Content-Security-Policy"
|
||||
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' http://8.138.234.141; connect-src 'self' http://8.138.234.141 https://api.iconify.design"
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="../src/renderer/views/knowledge/index.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
40
src/renderer/views/knowledge/index.ts
Normal file
40
src/renderer/views/knowledge/index.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import { createApp, type Plugin } from "vue"
|
||||
import errorHandler from '@utils/errorHandler'
|
||||
|
||||
// 引入 Element Plus 组件库
|
||||
import ElementPlus from 'element-plus'
|
||||
import locale from 'element-plus/es/locale/lang/zh-cn'
|
||||
|
||||
// 引入 i18n 插件
|
||||
import i18n from '@renderer/i18n'
|
||||
|
||||
import Knowledge from './index.vue'
|
||||
|
||||
// 样式文件隔离
|
||||
import '@renderer/styles/index.css'
|
||||
import 'element-plus/dist/index.css'
|
||||
|
||||
// 引入全局组件
|
||||
import HeaderBar from '@components/HeaderBar/index.vue'
|
||||
import DragRegion from '@components/DragRegion/index.vue'
|
||||
import Layout from '@components/Layout/index.vue'
|
||||
|
||||
const components: Plugin = (app) => {
|
||||
app.component('HeaderBar', HeaderBar);
|
||||
app.component('DragRegion', DragRegion);
|
||||
app.component('Layout', Layout);
|
||||
}
|
||||
|
||||
// 创建 Vue 应用实例
|
||||
const app = createApp(Knowledge);
|
||||
const pinia = createPinia();
|
||||
|
||||
// 使用 Pinia 状态管理
|
||||
app.use(pinia);
|
||||
app.use(ElementPlus, { locale })
|
||||
app.use(components)
|
||||
app.use(i18n)
|
||||
app.use(errorHandler)
|
||||
|
||||
// 挂载应用到 DOM
|
||||
app.mount("#app");
|
||||
@@ -5,7 +5,7 @@
|
||||
</header-bar>
|
||||
|
||||
<layout>
|
||||
|
||||
任务中心
|
||||
</layout>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -27,6 +27,7 @@ export default defineConfig(async () => {
|
||||
resolve(__dirname, 'html/setting.html'),
|
||||
resolve(__dirname, 'html/login.html'),
|
||||
resolve(__dirname, 'html/task.html'),
|
||||
resolve(__dirname, 'html/knowledge.html'),
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user