How to run vue files in the browser

青灯夜游
Release: 2023-01-11 09:22:51
Original
18205 people have browsed it

How to run the vue file in the browser: 1. Open the cmd command window and use the cd command to enter the vue project directory containing the vue file; 2. In the project directory, run the command "npm run dev" to start Project; 3. Enter "localhost:8080" in the browser address bar.

How to run vue files in the browser

The operating environment of this tutorial: windows7 system, vue2.9.6 version, DELL G3 computer.

The vue file is run in the browser

  • ##New vue file

The official example is as follows, you need to create the index.html file:

 

Copy after login

Then you need to create the myComponent.vue file, the file content is as follows:


  
Copy after login

  • Start the project

In cmd, use the cd command to enter the vue project

In the project directory, run the command

npm run devwill run our application using hot loading. Hot loading allows us to see the modified effects in real time without manually refreshing the browser after modifying the code.

  • Enter localhost:8080 in the browser.

Related recommendations: "

vue.js Tutorial"

The above is the detailed content of How to run vue files in the browser. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
run
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