Home> Web Front-end> Vue.js> body text

How to configure cross-domain files in vue.js

coldplay.xixi
Release: 2020-11-12 15:04:27
Original
3264 people have browsed it

How to configure cross-domain files in vue.js: first modify the [dev -- proxyTable] attribute in [index.js] under the config folder under the project; then set the target to the domain name that needs to be accessed; Finally, changeorigin is set to true to enable reverse proxy.

How to configure cross-domain files in vue.js

How to configure cross-domain files in vue.js:

1. When developing with vue, you often need to When it comes to cross-domain issues, in fact, there is a file for us to set up cross-domain requests in vue cli.

2. When cross-domain requests cannot be made, we can modify thedev -- proxyTableattributeinindex.js

under the config folder under the project.

How to configure cross-domain files in vue.js

3. Set the target to the domain name we need to access. (Backend IP address);

4,changeorigin: trueSet to true to enable reverse proxy

5,pathRiwrite '^/api':" "Write nothing

Related free learning recommendations:JavaScript(video)

The above is the detailed content of How to configure cross-domain files in vue.js. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!