HBuildx中使用vant的ui框架
输入 npm安装
npm i vant-weapp -S --production
或者yarn安装
yarn add vant-weapp --production
把dist中的文件全部拷贝出来,然后,在static’中新建一个文件夹,把dist的中的文件都粘贴到这里
然后就可以把node_modules删除了
然后在page。json中的当前文件中添加你要添加的组件
“usingComponents”: {
“van-button”: “…/…/static/vant/button/index” 你放置组件的地址
}
在index页面中引用就可以了
效果
注意点:
这个npm一定要勾选