This commit is contained in:
xiaojibeier
2026-07-18 23:13:11 +08:00
parent b49c30a081
commit 87bfc7b54e
17 changed files with 1871 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
<template>
<router-view />
</template>
<script setup>
</script>
+19
View File
@@ -0,0 +1,19 @@
*,
*::before,
*::after {
box-sizing: border-box;
}
html,
body,
#app {
margin: 0;
min-height: 100%;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
color: #303133;
background: #fff;
}
+16
View File
@@ -0,0 +1,16 @@
import '@/assets/styles/base.css'
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import App from './App.vue'
import router from './router'
import { setupStore } from './store'
const app = createApp(App)
app.use(ElementPlus, { locale: zhCn })
setupStore(app)
app.use(router)
app.mount('#app')
+14
View File
@@ -0,0 +1,14 @@
import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
name: 'home',
component: () => import('@/views/Home.vue'),
},
],
})
export default router
+9
View File
@@ -0,0 +1,9 @@
import { createPinia } from 'pinia'
const pinia = createPinia()
export function setupStore(app) {
app.use(pinia)
}
export default pinia
+15
View File
@@ -0,0 +1,15 @@
import { defineStore } from 'pinia'
import { ref } from 'vue'
export const useAppStore = defineStore('app', () => {
const title = ref('威海 ERP 项目管理')
function setTitle(value) {
title.value = String(value || '').trim() || '威海 ERP 项目管理'
}
return {
title,
setTitle,
}
})
+60
View File
@@ -0,0 +1,60 @@
<template>
<div class="pm-home">
<el-card shadow="never" class="pm-home-card">
<template #header>
<div class="pm-home-head">
<span class="pm-home-title">{{ appStore.title }}</span>
<el-tag type="success" effect="plain">Vue 3 + Vite + Element Plus + Pinia</el-tag>
</div>
</template>
<p class="pm-home-desc">需求池 / 缺陷池看板将在这里搭建。</p>
<el-button type="primary" @click="onReady">开始</el-button>
</el-card>
</div>
</template>
<script setup>
import { ElMessage } from 'element-plus'
import { useAppStore } from '@/store/modules/app'
const appStore = useAppStore()
function onReady() {
ElMessage.success('前端脚手架已就绪')
}
</script>
<style scoped>
.pm-home {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 24px;
background: #f5f7fa;
box-sizing: border-box;
}
.pm-home-card {
width: min(560px, 100%);
}
.pm-home-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.pm-home-title {
font-size: 18px;
font-weight: 600;
color: #303133;
}
.pm-home-desc {
margin: 0 0 16px;
color: #606266;
line-height: 1.6;
}
</style>