Detailed steps for connecting Mini Program to vant Weapp components

The file structure of the project
Insert picture description here
you just created First open a terminal in the root directory of your project and enter npm init to initialize the project
Insert picture description here

The pachage.json file will be generated at this time.

Insert picture description here
Continue to run the following commands in the terminal

Insert picture description here
I use this here:

npm and vant-weapp -S --production

As shown in the figure after running:

Insert picture description here
After the installation is successful, return to the applet development tool and click Tools => Build npm

Insert picture description here
Screenshot after running:

Insert picture description here
After completion, tick the red box in the details on the right side of the editor

Insert picture description here
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.

Insert picture description here
effect:

Insert picture description here
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

Guess you like

Origin blog.csdn.net/Smell_rookie/article/details/109285435