ElementUI的基础用法
# 安装
npm i element-ui -S
1
# 使用
完整引入
// main.js
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
1
2
3
4
2
3
4
按需引入
babel插件支持
npm install babel-plugin-component -D
1
babel配置修改
1
使用
import { Button, Select } from 'element-ui';
// 写法一:
Vue.component(Button.name, Button);
Vue.component(Select.name, Select);
// 写法二:
Vue.use(Button)
Vue.use(Select)
1
2
3
4
5
6
7
2
3
4
5
6
7
编辑 (opens new window)
上次更新: 2022/10/25, 02:40:54