小程序npm构建vant

120 阅读1分钟

1:创建小程序

2:在cmd终端里面 输入 npm i @vant/weapp

3:点击使用npm模块

image.png 4: 点击工具构建npm

image.png

5:将 app.json 中的  "style": "v2"  去除

6:去Vant Weapp选择你要使用的组件


1:先引入

image.png

2: CV代码

                <van-button type="default">默认按钮</van-button>
                <van-button type="primary">主要按钮</van-button>
                <van-button type="info">信息按钮</van-button> 
                <van-button type="warning">警告按钮</van-button>
                <van-button type="danger">危险按钮</van-button>
                

3:完成:

image.png

更多案例详情见官网