feat(router): 初始化项目路由与页面结构
- 删除默认示例组件 HelloWorld.vue 及相关代码 - 使用 <router-view> 替换 App.vue 中的默认内容 - 引入并应用 Vue Router,实现基础页面路由配置 - 在 main.js 中注册路由插件 - 添加首页组件 index.vue,作为根路径路由的目标组件 - 配置 vite 别名 '@' 指向 src 目录,方便路径引用 - 添加 Element Plus、Flowbite 和 Vue Router 依赖,集成 UI 框架 - 配置自动导入和组件按需加载插件,简化开发流程 - 配置 Tailwind CSS 及 Flowbite 插件,设置样式基础 - 创建主样式文件 main.css 并导入 Tailwind 指令 - 添加 postcss 配置支持 Tailwind 和 autoprefixer
This commit is contained in:
@@ -1,7 +1,26 @@
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import AutoImport from 'unplugin-auto-import/vite'
|
||||
import Components from 'unplugin-vue-components/vite'
|
||||
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
||||
|
||||
// https://vite.dev/config/
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
plugins: [
|
||||
vue(),
|
||||
AutoImport({
|
||||
resolvers: [ElementPlusResolver()],
|
||||
}),
|
||||
Components({
|
||||
resolvers: [ElementPlusResolver()],
|
||||
}),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
// 定义一个别名 '@',该别名对应于当前 JavaScript 模块文件所在目录下的 'src' 目录的绝对文件路径。
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user