Vue中引入element-ui
1.安装
npm i element-ui -s
2.在main.js入口文件中引入element-ui
() //引入完整的element import ElementUI from 'element-ui' import 'element-ui/lib/theme-chalk/index.css' Vue.use(ElementUI); ()
3.使用组件
比如使用button组件
import {Button} from 'element-ui'; Vue.use(Button)
在.vue文件中使用方法为
<el-button></el-button>
若加入样式则为<el-button type='primary' plain></el-button>
本文详细介绍了如何在Vue项目中引入并使用Element-UI组件库,包括安装步骤、在main.js中引入Element-UI、以及如何使用Element-UI的Button组件。
1487

被折叠的 条评论
为什么被折叠?



