摘要: // 封装axios import axios from "axios"; const http = axios.create({ baseURL: "http://localhost:3006/api", timeout: 5000 }) // 请求拦截 http.interceptors.req 阅读全文
posted @ 2022-08-21 20:00 HuangBingQuan 阅读(42) 评论(0) 推荐(0) 编辑
摘要: 目前主流的跨域解决方案有两种 1. 后台解决(cors) 2. 前台解决(proxy) // 在 vue.config.js 中添加配置 devServer: { proxy: { '/api': { target: '<url>', changeOrigin: true } } } // 跨域配置 阅读全文
posted @ 2022-08-21 19:57 HuangBingQuan 阅读(38) 评论(0) 推荐(0) 编辑
摘要: 在vue-cli中使用scss 安装 node-sass sass-loader,yarn add node-sass sass-loader --dev 在style标签中,添加lang属性,lang="scss" 最后在里面编写scss代码即可 组件样式被scope保护 组件样式被scope保护 阅读全文
posted @ 2022-08-21 10:29 HuangBingQuan 阅读(179) 评论(0) 推荐(0) 编辑