Install node environment
slightly
Install vue scaffolding, online
npm install -g @vue/cli
PS: vue-cli has entered maintenance mode. The latest scaffolding of vue3 is installed using npm init vue@latest. After installation, use create-vue to replace the vue command. The bottom layer of create-vue uses vite to improve front-end development efficiency (Note16.0+)
Use the command to create a uniapp project, online
By default, https://registry.npmmirror.com is used as the mirror source.
vue create -p dcloudio/uni-preset-vue my-project
Choose a template
If you cannot download it, you can use offline mode and specify the template location to be used locally.
Download uniapp offline template, online
gitee store:
https://gitee.com/dcloud/uni-preset-vue/tree/vite
https://gitee .com/dcloud
uni-preset-vue-master.zip
uni-preset-vue-vite.zip
Create an h5 project of uniapp offline version offline
vue create -p D:/uni-preset-vue-master my-project
Here you can specify the template directory as D:/uni-preset-vue-master
There will be dependencies after downloading by default. If the dependencies are not initialized, use the following command to initialize the module dependencies:
npm install
File structure: a>
run
Open the console and enter the root directory
Run the command:
npm run serve
Default access address: http://localhost:8080/#/
Run using HBuilderX
Package npm run build