vant程序:
https://youzan.github.io/vant-weapp/#/intro
vant移动端:
https://youzan.github.io/vant/#/zh-CN/intro
vue3.0:
https://cli.vuejs.org/zh/
vue2.0:
https://cn.vuejs.org/v2/guide/
通过 npm 安装
npm i vant -S
安装babel-plugin-import
npm i babel-plugin-import -D
在babelrc文件中配置plugins
{
“plugins”: [
[“import”, {
“libraryName”: “vant”,
“libraryDirectory”: “es”,
“style”: true
}]
]
}
vant使用
在main.js中全局注册vant相关组件
在新建的vue模板中
<template>
<div>
<van-buttontype=”primary”>主要按钮</van-button>
</div>
</template>
结果显示: