Attachment: the official website quick start link (click me to jump directly)
Open the command line
1. Install wepy globally
npm install @wepy/cli -g
Check the installation is successful
wepy --help
The global installation is successful
2. New project
1. Execute the command (wepy_test is the name of the project, you can fill in at will)
wepy init standard wepy_test
Created successfully
2. Enter the project
Project directory
Installation dependencies
cnpm install
You can use it after the installation is successful
npm run dev
Start and compile the project
Three. View the project
Use the developer tools to import the root directory of the new project to preview the effect.
Project directory structure
Those who have studied vue understand that this directory structure is the same as vue-cli
added successfully
4. Introduce vant components
Attachment: Please click here on vant official website
Excuting an order
cnpm i @vant/weapp -S --production
Put the dist folder in vant_weapp under node_modules into the components folder
usingComponents: {
'van-button': '../components/vant/button/index'
}
Just try to introduce a component, whether it is successful
Successful display, successful introduction