Quick Vue Project Creation Without Commands
The traditional way to create a Vue3 scaffold requires npm commands, which is not only cumbersome but also often fails due to network issues. Today, I’ll teach you a method to quickly create a Vue3 project without commands, using entirely graphical operations.
Steps
-
Download
HBuilderX
- Download link: HBuilderX
-
After downloading, it’s a compressed package. We extract it and run
HBuilderX.exe
. -
The first run will prompt you to choose a theme. You can select any theme, as this software doesn’t provide much help for development.
-
Click
File -> New -> Project
on the menu bar to create a new project. -
In the pop-up window, select
Regular Project
, scroll down to findVue3 Project
, give the project a name, set the storage location for the project, and finally click create. -
Wait for the software to automatically create the project.
-
After successful creation, we directly close
HBuilderX
. That’s right, close the compilation software. -
Find the folder where the project is stored and open the project with
Visual Studio Code
. -
Install Vue development language support in the extensions.
-
Then you can start writing Vue code.
Note: Running a Vue project in VS requires installing Node.js yourself. The Node.js used when creating the project was the one bundled with HBuilderX, and these two are not compatible.
Template Code
I recommend to everyone my commonly used Vue3 template code. Using this template can help improve efficiency.
1 | <template> |
- template tag: HTML page.
- script tag: JavaScript script code.
- data function: Variable data.
- mounted function: Code executed when the page starts.
- methods: Method functions.
- style tag: CSS styles for this page.