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
Execute the create table statement in the databas...
Table of contents background analyze Data simulat...
Three ways to configure Nginx The first method di...
This article shares the installation and activati...
Phrase elements such as <em></em> can ...
Table of contents 1. Effect 2. Main code 1. Effec...
I have recently been developing a visual operatio...
Preface Let me share with you how to make a searc...
I have been playing around with charts for a whil...
Table of contents 1. Use help information 2. Crea...
The most understandable explanation of the accura...
Table of contents background Provide / Inject Ext...
<br />We have always emphasized semantics in...
I just happened to encounter this small requireme...
Table of contents 1. Environment 2. Preparation 3...