1. Speaking of the vant framework, I believe everyone should be familiar with it. Friends who have done mobile terminal development should all know it. 2. Vant is an open source mobile component library developed by Youzan’s front-end team . It was open sourced in 2017 and has been maintained for 4 years. Vant carries all of Youzan's core businesses internally and serves more than 100,000 developers externally. It is one of the mainstream mobile component libraries in the industry. 3. Let’s not waste any more time and get straight to today’s topic. How do we use the vant component library in WeChat applet? first Let's open the vant weapp website first. Here I will give you the website address. Vant Weapp website After you open the website, click on Get Started Quickly. The above steps teach you how to use the vant component library in the mini program. Next, I will introduce to you how I install and use the vant UI component library. 1. Open the project directory of our applet, and then open the location of the file.2. Initialize project filesHere I initialize through the cmd window 3. Enter the command to initialize the projectnpm init At this point you will find that there is an additional package.json file in your directory 4. Install dependencies4.1 Install vant/weapp via npm npm i @vant/weapp -S --production 4.2 Installing the miniprogram npm i miniprogram-sm-crypto --production After the installation is complete, you will find some more files in your directory. 4.3 Modify app.json Remove 4.4 Modify project.config.json For projects created by developer tools, { ... "setting": { ... "packNpmManually": true, "packNpmRelationList": [ { "packageJsonPath": "./package.json", "miniprogramNpmDistDir": "./miniprogram/" } ] } } 4.5 Build npm We click the toolbar in the upper left corner After the build is successful, the following screen will appear 4.6 Then click Details in the upper right corner---Local Settings---Use npm module 5. Use componentsI register a button globally and then use it. First register in app.json Here I will randomly find a page to use this button component. You can see that I used it successfully. This concludes this article on the specific steps of using the vant framework in WeChat mini programs. For more content on using the vant framework in mini programs, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Shell script settings to prevent brute force ssh
>>: Solution for front-end browser font size less than 12px
I will not introduce what CUDA is, but will direc...
Through JavaScript, we can prevent hyperlinks fro...
Preface The origin is a question 1: If your umask...
Authorization is to grant certain permissions to ...
This article mainly introduces the relevant conte...
Download source code git clone https://github.com...
Table of contents Preface 1. Recursive components...
When we encounter a fault, we often think about h...
Detailed explanation of JDBC database link and re...
lead Some common triangles on web pages can be dr...
Preface With the development of big front-end, UI...
Here are a few ways to remove it: Add the link dir...
Pitfalls encountered during project deployment Wh...
Table of contents Problem Description Principle A...
Table of contents Classic approach question Furth...