1 Star 0 Fork 0

不凡/vie+vue3

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
README.md 2.50 KB
一键复制 编辑 原始数据 按行查看 历史
63977203@qq.com 提交于 9个月前 . init project

Vue 3 + TypeScript + Vite

This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 <script setup> SFCs, check out the script setup docs to learn more.

Learn more about the recommended Project Setup and IDE Support in the Vue Docs TypeScript Guide.

#项目创建 npm init vite //创建项目
选择typescript npm install //安装依赖
npm run dev //运行项目

#安装store npm install pinia -S //安装pinia(VUEX状态管理工具) 创建src/store文件夹,并建立index.ts文件

#配置router及安装 npm install vue-router -S // 安装vue-router
src下创建router文件夹,并创建index.ts

#安装api封装组件 npm install @vueuse/core -S // 安装api插件 npm install axios -S // 安装请求插件 创建 src/utils/require.ts // 封装请求文件

#创建api文件夹 src下创建api文件夹,并创建user.ts user.ts // 用户接口

#配置跨域代理 vite.config.js // 配置跨域代理
server:{ // 端口号 port: 8080, // 自动打开浏览器 open: true, // 跨域设置 proxy:{ '/api': 'http://www.laneol.com' }, // 允许跨域 cors: true }, server:{ // 自动打开浏览器 open: true, // 跨域设置 proxy:{ '/api': 'http://localhost:8080' } },

#rem适配 src文件夹的utils文件夹下新建rem.ts main.ts 中全局引用 rem.ts

#ui框架引入 element-plus npm install element-plus --save // 安装element-plus ui框架 npm install -D unplugin-vue-components unplugin-auto-import // 首先你需要安装unplugin-vue-components 和 unplugin-auto-import这两款插件 npm install @element-plus/icons-vue // 安装element-plus图标

Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/sun_xichao/vie-vue3.git
git@gitee.com:sun_xichao/vie-vue3.git
sun_xichao
vie-vue3
vie+vue3
master

搜索帮助