Home > Article > Web Front-end > How to solve the problem that vuejs cannot be accessed using IP
Solution to the inability to access IP in vuejs: 1. Check index.js in the config folder; 2. Modify index.js and change "host: 'localhost'" to "host: '0.0 .0.0'"; 3. Restart the Vue project.
The operating environment of this tutorial: windows7 system, vue2.9.6 version, DELL G3 computer.
Vue.js - How to solve the problem that the Vue project IP address is inaccessible?
The webpack project started by Vue scaffolding vue-cli can be accessed normally using localhost. However, when switching to IP, it will prompt that the website cannot be accessed. The following is a detailed introduction.
When writing a project, sometimes the localhost link can be accessed normally, but we need to access the changed address on other devices, so we need the IP address for access, but the IP Access prompt: We cannot access this website.
View index.js in the config folder
Modify index.js and change host: 'localhost' to host: '0.0.0.0'
##Ps: Finally, remember to restart the Vue project. Can~ Recommended: "The latest 5 vue.js video tutorial selections"
The above is the detailed content of How to solve the problem that vuejs cannot be accessed using IP. For more information, please follow other related articles on the PHP Chinese website!