feat: 首页调整
This commit is contained in:
@@ -11,6 +11,6 @@
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="../src/renderer/main.ts"></script>
|
||||
<script type="module" src="../src/renderer/views/home/index.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { menus } from '@constant/menus'
|
||||
import { useRouter } from "vue-router";
|
||||
import { useRouter } from "vue-router"
|
||||
|
||||
const router = useRouter();
|
||||
const router = useRouter()
|
||||
const currentId = ref(1)
|
||||
|
||||
const handleClick = async (item: any) => {
|
||||
@@ -14,11 +14,11 @@
|
||||
<TaskList />
|
||||
</div>
|
||||
|
||||
<Menus />
|
||||
<SideMenus />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="Layout">
|
||||
import TaskList from '@renderer/components/TaskList/index.vue'
|
||||
import Menus from '@renderer/components/Menus/index.vue'
|
||||
import SideMenus from '@renderer/components/SideMenus/index.vue'
|
||||
</script>
|
||||
38
src/renderer/views/home/index.ts
Normal file
38
src/renderer/views/home/index.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
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 Home 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'
|
||||
|
||||
const components: Plugin = (app) => {
|
||||
app.component('HeaderBar', HeaderBar);
|
||||
app.component('DragRegion', DragRegion);
|
||||
}
|
||||
|
||||
// 创建 Vue 应用实例
|
||||
const app = createApp(Home);
|
||||
const pinia = createPinia();
|
||||
|
||||
// 使用 Pinia 状态管理
|
||||
app.use(pinia);
|
||||
app.use(ElementPlus, { locale })
|
||||
app.use(components)
|
||||
app.use(i18n)
|
||||
app.use(errorHandler)
|
||||
|
||||
// 挂载应用到 DOM
|
||||
app.mount("#app");
|
||||
@@ -1,6 +1,12 @@
|
||||
<template>
|
||||
<div class="bg-white box-border w-full h-full rounded-[16px] flex">
|
||||
首页
|
||||
<div class="bg-gray-100 h-screen flex flex-col">
|
||||
<header-bar>
|
||||
<drag-region class="w-full" />
|
||||
</header-bar>
|
||||
|
||||
<main class="box-border rounded-[16px]">
|
||||
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user