Vue2安装Vant

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>

结果显示:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/ee_11eeeeee/article/details/97538172
今日推荐