# vue3商城项目 **Repository Path**: casepro/vue3 ## Basic Information - **Project Name**: vue3商城项目 - **Description**: vue3商城项目前后端 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-07-19 - **Last Updated**: 2024-03-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # vue3 #### 介绍 vue3商城项目前后端 ## 项目搭建 > 拉取项目到本地 ```git git clone https://gitee.com/casepro/vue3.git ``` > 下载依赖,有二种方式安装,二选一 ```sh npm install || yarn install ``` > 运行项目 ```sh npm run dev|| yarn dev ``` > 打包H5项目 ```sh npm run build || yarn build ``` > 修改H5接口地址 ./vue.config.js ```js import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import path from 'path' // https://vitejs.dev/config/ export default defineConfig({ resolve: { alias: { "@": path.resolve(__dirname, "src"), "components": path.resolve(__dirname, "src/components"), 'vue': 'vue/dist/vue.esm-bundler.js' // 定义vue的别名,如果使用其他的插件,可能会用到别名 }, }, server: { proxy: { //设置代理请求 当代理商识别你的请求如果前缀是 /api的话 就会自动转移 '/shop': { target: 'http://www.laravel.com/shop', changeOrigin:true, //跨域 //替换掉api前缀 防止多个api地址 rewrite: (path) => path.replace(/^\/shop/, '') } }, hmr: { overlay: false, }, }, plugins: [vue()], }) ```