The file structure of the project
you just created First open a terminal in the root directory of your project and enter npm init to initialize the project
The pachage.json file will be generated at this time.
Continue to run the following commands in the terminal
I use this here:
npm and vant-weapp -S --production
As shown in the figure after running:
After the installation is successful, return to the applet development tool and click Tools => Build npm
Screenshot after running:
After completion, tick the red box in the details on the right side of the editor
Use components
Introduce the component in the json file you want to use the component library. For example, you want to use the button component in the fundIncome page.
effect:
The above code refers to vant's official website document .
The above is all the content of the vant weapp component used by the applet. If it is helpful, please like it!
If you have any questions, you can directly add wx to chat with me huang009516