- 从vant-weapp的git仓库中下载源码
地址:https://github.com/youzan/vant-weapp -
把vant-weapp中dist 文件重命名改下,粘贴复制到自己项目下面的静态文件中,如图:将dist文件重命名为vant,将其粘贴复制到static下面
image.png - 引入在需要的文件夹中的main.json
"usingComponents": {
"van-notice-bar": "/static/vant/notice-bar/index"
//此路径就是你放在哪个文件夹下面的路径~
}
在对应的index.vue直接使用标签即可
<template>
<div>
<van-notice-bar left-icon="volume-o"/>
</div>
</template>
- 运行即可 npm run dev
-
⚠️:将开发者工具设置改下!!!! 一定要把es6转es5这项打勾☑️
image.png

