- 博客(2)
- 收藏
- 关注
原创 解决跨域问题 - 配置代理
在 vue.config.js 文件中: // = webpack.config.js : 对外暴露,用于配置代理等 module.exports ={ // 代理跨域 devServer:{ proxy:{ '/api':{ target:'http://39.98.xxx.....', // 服务器地址 // pathRewrite:{'^api':''} // 发送请求时,重写请求路
2022-01-11 18:09:42
144
原创 解决 this.$router.push 多次执行时报 navigationDuplicated 错误
在 Router / index.js (路由配置文件) 中: /* 1. 备份push方法 */ let originPush = VueRouter.prototype.push console.log(originPush); /* 2. 重写push方法 */ /* location:跳转地址,传递的参数 resolve:成功时回调 reject:失败时回调 */ VueRouter.prototype.push = function (location, resolve, r
2022-01-11 16:33:22
348
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人