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

How to solve the problem that vuejs cannot be accessed using IP

藏色散人
Release: 2021-11-01 11:12:03
Original
3426 people have browsed it

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.

How to solve the problem that vuejs cannot be accessed using IP

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!

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template