From 4f5a36621fa67b6f7dcffbed870eb42efcd8ed0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?mac=C2=B7ufutx?= Date: Thu, 12 Jun 2025 19:01:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=2020250612=20=E9=A6=96=E9=A1=B5=E3=80=81N?= =?UTF-8?q?avbar=E3=80=81Footer=E7=AD=89=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 4 + package.json | 2 + postcss.config.cjs | 2 +- src/App.vue | 38 +--- src/assets/images/logo.png | Bin 0 -> 5956 bytes src/main.ts | 14 ++ src/router/routes.ts | 75 +++++--- src/style.css | 4 +- src/views/Home/Home.vue | 31 +++ src/views/Home/sections/Banner.vue | 95 ++++++++++ src/views/Home/sections/CoreValue.vue | 50 +++++ src/views/Home/sections/CustomerFeedback.vue | 188 +++++++++++++++++++ src/views/Home/sections/GlobalService.vue | 50 +++++ src/views/Home/sections/Partners.vue | 124 ++++++++++++ src/views/Home/sections/UseCases.vue | 113 +++++++++++ vite.config.ts | 31 ++- 16 files changed, 753 insertions(+), 68 deletions(-) create mode 100644 src/assets/images/logo.png create mode 100644 src/views/Home/Home.vue create mode 100644 src/views/Home/sections/Banner.vue create mode 100644 src/views/Home/sections/CoreValue.vue create mode 100644 src/views/Home/sections/CustomerFeedback.vue create mode 100644 src/views/Home/sections/GlobalService.vue create mode 100644 src/views/Home/sections/Partners.vue create mode 100644 src/views/Home/sections/UseCases.vue diff --git a/components.d.ts b/components.d.ts index d5b6134..9ff4061 100644 --- a/components.d.ts +++ b/components.d.ts @@ -8,7 +8,11 @@ export {} /* prettier-ignore */ declare module 'vue' { export interface GlobalComponents { + ElTabPane: typeof import('element-plus/es')['ElTabPane'] + ElTabs: typeof import('element-plus/es')['ElTabs'] + Footer: typeof import('./src/components/Footer.vue')['default'] HelloWorld: typeof import('./src/components/HelloWorld.vue')['default'] + Navbar: typeof import('./src/components/Navbar.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] Test: typeof import('./src/components/Test.vue')['default'] diff --git a/package.json b/package.json index 56a2f4f..9f8a9a5 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "dependencies": { "@vueuse/core": "^13.3.0", "axios": "^1.9.0", + "element-plus": "^2.10.1", "pinia": "^2.1.7", "postcss-px-to-viewport": "^1.1.1", "vue": "^3.5.13", @@ -52,6 +53,7 @@ "postcss": "^8.4.24", "postcss-px-to-viewport-8-plugin": "^1.2.5", "prettier": "^3.5.3", + "sass": "^1.89.2", "typescript": "5.1.6", "unplugin-auto-import": "^19.3.0", "unplugin-vue-components": "^28.7.0", diff --git a/postcss.config.cjs b/postcss.config.cjs index 6362885..303c5eb 100644 --- a/postcss.config.cjs +++ b/postcss.config.cjs @@ -32,7 +32,7 @@ module.exports = { plugins: { 'postcss-px-to-viewport-8-plugin': { unitToConvert: 'px', - viewportWidth: 750, + viewportWidth: 1920, unitPrecision: 5, viewportUnit: 'vw', fontViewportUnit: 'vw', diff --git a/src/App.vue b/src/App.vue index 4a48484..ad7ce98 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,42 +1,14 @@ - diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..4f1c98171ed96125208a7fe6bb1d657f18cbec5f GIT binary patch literal 5956 zcmV-K7rW?*P)2i&ttRTq>N?Adi6+{`?&LqwXimp+e^Y^ip z6@x{o zGvMRzus0for(q!NI{{tMOn6kt9J6 zCVe5`DU_4o5}06v+dqDJ4Gs|P@4x~X5~%ucIOSA6_f8h(8->DReD=uBn!T&on3#IygXx&maT~ z*a|{aD)Qu`V6YF?A*>T3s73AzJkMAg3LBtOwMtG?qc(7f}Q|zf`;)EB*@>8ypK(#UoFY`&=7czDEXQTn)@Zd zF%(M-ErX>0LPGpU@L_)nJixX2SmaAB5hIdd{4)b@WmO)L?|XNTM+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agFemd@QF$&;c(S;ipjbXqNySwmZ88Bt1?Ii|9pyH`UTzaHM<-!ys zLE^o5&A_ZzFp}+4v?mU$s#f1oV)a;d7!!y5hDtft5HZ$GJw8HdxqhQ-v16MvMc)0_ z^JZk5q-j3mrWZj)=zIT_tGOM5C6rtAD?ms3e}QHg-QAoWfP;gBL&s>}vaB%1vHoVOB4B}+-l3q|3(&6CXuo|>(L#)%aOxX<2UV?*zgTo5Zx`e1pa+ykb zW5L*|BSQxVhjl>fgh(nc_2DfUHm2|jRFNMw?ab!j;NZ{}TJ { // 安装 i18n 插件 ctx.app.use(i18n) + ctx.app.use(ElementPlus, { + locale: zhCn + }) // 路由守卫:设置页面标题 ctx.router.beforeEach((to, _from, next) => { diff --git a/src/router/routes.ts b/src/router/routes.ts index 8bc365c..852d83d 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -1,40 +1,53 @@ // src/router/routes.ts import type { RouteRecordRaw } from 'vue-router' // 添加type关键字 -import Home from '@/views/Home.vue' -import About from '@/views/About.vue' -import I18nDemo from '../views/I18nDemo.vue' - +import Home from '@/views/Home/Home.vue' +// import About from '@/views/About.vue' +// import I18nDemo from '../views/I18nDemo.vue' +import Layout from '@/layout/Layout.vue' const routes: RouteRecordRaw[] = [ - { - path: '/i18n-demo', - name: 'I18nDemo', - component: I18nDemo, - meta: { - title: '国际化演示' - } - }, { path: '/', - name: 'Home', - component: Home, - meta: { - title: '首页 - 极简官网' // 明确指定title为string类型 - } as { title: string } // 强制类型断言 - }, - { - path: '/about', - name: 'About', - component: About, - meta: { - title: '关于我们 - 极简官网' - } as { title: string } - }, - { - path: '/:pathMatch(.*)*', - name: 'NotFound', - component: () => import('@/views/NotFound.vue'), - meta: { title: '404 - 页面不存在' } as { title: string } + component: Layout, + children: [ + { path: '', name: 'Home', component: Home }, + { path: 'news', name: 'News', component: () => import('@/views/News.vue') }, + { path: 'network', name: 'Network', component: () => import('@/views/Network.vue') }, + { path: 'dating', name: 'Dating', component: () => import('@/views/Dating.vue') }, + { path: 'app', name: 'App', component: () => import('@/views/App.vue') }, + { path: 'ecosystem', name: 'Ecosystem', component: () => import('@/views/Ecosystem.vue') }, + { path: 'about', name: 'About', component: () => import('@/views/About.vue') } + ] } + // { + // path: '/i18n-demo', + // name: 'I18nDemo', + // component: I18nDemo, + // meta: { + // title: '国际化演示' + // } + // }, + // { + // path: '/', + // name: 'Home', + // component: Home, + // meta: { + // title: '首页 - 极简官网' // 明确指定title为string类型 + // } as { title: string } // 强制类型断言 + // }, + // { + // path: '/about', + // name: 'About', + // component: About, + // meta: { + // title: '关于我们 - 极简官网' + // } as { title: string } + // }, + // { + // path: '/:pathMatch(.*)*', + // name: 'NotFound', + // component: () => import('@/views/NotFound.vue'), + // meta: { title: '404 - 页面不存在' } as { title: string } + // } ] export default routes diff --git a/src/style.css b/src/style.css index 79ef228..8b122da 100644 --- a/src/style.css +++ b/src/style.css @@ -62,9 +62,9 @@ button:focus-visible { } #app { - max-width: 1280px; + /*max-width: 1280px;*/ margin: 0 auto; - padding: 2rem; + /*padding: 2rem;*/ text-align: center; } diff --git a/src/views/Home/Home.vue b/src/views/Home/Home.vue new file mode 100644 index 0000000..bc32358 --- /dev/null +++ b/src/views/Home/Home.vue @@ -0,0 +1,31 @@ + + + + + diff --git a/src/views/Home/sections/Banner.vue b/src/views/Home/sections/Banner.vue new file mode 100644 index 0000000..1f7bc3b --- /dev/null +++ b/src/views/Home/sections/Banner.vue @@ -0,0 +1,95 @@ + + + + + diff --git a/src/views/Home/sections/CoreValue.vue b/src/views/Home/sections/CoreValue.vue new file mode 100644 index 0000000..da32bf3 --- /dev/null +++ b/src/views/Home/sections/CoreValue.vue @@ -0,0 +1,50 @@ + + + + + diff --git a/src/views/Home/sections/CustomerFeedback.vue b/src/views/Home/sections/CustomerFeedback.vue new file mode 100644 index 0000000..ed332d5 --- /dev/null +++ b/src/views/Home/sections/CustomerFeedback.vue @@ -0,0 +1,188 @@ + + + + + diff --git a/src/views/Home/sections/GlobalService.vue b/src/views/Home/sections/GlobalService.vue new file mode 100644 index 0000000..0335937 --- /dev/null +++ b/src/views/Home/sections/GlobalService.vue @@ -0,0 +1,50 @@ + + + + + diff --git a/src/views/Home/sections/Partners.vue b/src/views/Home/sections/Partners.vue new file mode 100644 index 0000000..9e54dd9 --- /dev/null +++ b/src/views/Home/sections/Partners.vue @@ -0,0 +1,124 @@ + + + + + diff --git a/src/views/Home/sections/UseCases.vue b/src/views/Home/sections/UseCases.vue new file mode 100644 index 0000000..16e8629 --- /dev/null +++ b/src/views/Home/sections/UseCases.vue @@ -0,0 +1,113 @@ + + + + + diff --git a/vite.config.ts b/vite.config.ts index 252c7ec..e706f19 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,20 +5,38 @@ import path from 'path' // 引入 path 模块 import viteImagemin from 'vite-plugin-imagemin' // 新插件 import AutoImport from 'unplugin-auto-import/vite' import Components from 'unplugin-vue-components/vite' +// 引入 ElementPlus 相关解析器 +import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' import legacy from '@vitejs/plugin-legacy' export default defineConfig({ plugins: [ vue(), + legacy({ targets: ['ie >= 11'], additionalLegacyPolyfills: ['regenerator-runtime/runtime'], modernPolyfills: true // 启用现代浏览器的 polyfill }), AutoImport({ - imports: ['vue', 'vue-router'] // 自动导入 Vue、Vue Router API + imports: ['vue', 'vue-router'], // 自动导入 Vue、Vue Router API + // 自动导入 Vue 相关函数,以及 ElementPlus 的相关函数等 + resolvers: [ + ElementPlusResolver({ + importStyle: 'sass', // 可选:按需导入样式 + directives: true, // 导入指令 + version: '2.3.6' // 版本号 + }) + ] }), Components({ + // 自动导入 ElementPlus 的组件 + resolvers: [ + ElementPlusResolver({ + importStyle: 'sass', + directives: true + }) + ], dirs: ['src/components'] // 自动扫描组件目录 }), viteImagemin({ @@ -42,6 +60,17 @@ export default defineConfig({ } } }, + css: { + preprocessorOptions: { + less: { + // 关键配置:自动注入 global.less + additionalData: `@import "@/styles/global.less";`, + + // 可选:如果需要自定义 Less 选项 + javascriptEnabled: true + } + } + }, resolve: { alias: { '@': path.resolve(__dirname, 'src') // 添加路径别名