P3 component library_3. Installation and use of Vant Weapp

P3 component library_3. Installation and use of Vant Weapp

 

https://youzan.github.io/vant-weapp/#/quickstart

 

 

Open the command line 

Note that it was installed before.

If nodejs is not installed

Baidu about nodejs 

installation

 

note:

installation

 

Generation:

 

Install at this time

npm i @vant/weapp -S --production

 

 

Check in the developer tools

 

Then build npm 

 

Successfully built

 

 

 

The app.json the  "style": "v2" removal of

Add to

"usingComponents": {
  "van-button": "@vant/weapp/button/index"
}

 

Error:

[ WXML 文件编译错误] ./miniprogram_npm/@vant/weapp/action-sheet/index.wxml
../wxs/utils.wxs not found from ./miniprogram_npm/@vant/weapp/action-sheet/index.wxml
> 1 | <wxs src="../wxs/utils.wxs" module="utils" />
    | ^
  2 | 
  3 | <van-popup
  4 |   show="{
   
   { show }}"
at files://miniprogram\miniprogram_npm\@vant\weapp\action-sheet\index.wxml#1

 

The button effect comes out

 

Add an icon to the button

 

<van-button type="info" icon="star-o">主要按钮</van-button>

 

=========== Come to an effect

<van-button bindtap="onClick" type="info" icon="gem">主要按钮</van-button>

 

 

 

 

 

 

Guess you like

Origin blog.csdn.net/huanglianggu/article/details/107443532