目录
Cube UI https://didi.github.io/cube-ui/
Mint UI http://mint-ui.github.io/#!/zh-cn (vue 2.0)
NUT UI https://nutui.jd.com/#/
Element UI https://element.eleme.cn/#/zh-CN
IView UI http://v1.iviewui.com/
首先安装element-ui:
npm install element-ui
然后安装 babel-plugin-component:
npm install babel-plugin-component -D
修改babel.config.js:
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset',
["@babel/preset-env", { "modules": false }],
],
plugins: [
[
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}
]
]
}
在main.js按需引入组件
//引入Vue
import Vue from "vue";
//引入App
import App from './App';
//完整引入
// 引入element-ui组件库
// import ElementUI from 'element-ui';
/// 引入element全部样式
// import 'element-ui/lib/theme-chalk/index.css';
// 使用element ui插件库
// Vue.use(ElementUI);
//按需引入
import { Button, Input, Row, DatePicker } from 'element-ui';
Vue.use(Button);
Vue.use(Input);
Vue.use(Row);
Vue.use(DatePicker);
//关闭Vue的生产提示
Vue.config.productionTip = false;
new Vue({
el: '#app',
render: h => h(App),
});
然后在App.vue使用
<div class="block">
<span class="demonstration">默认</span>
<el-date-picker
type="date"
placeholder="选择日期">
</el-date-picker>
</div>
<el-row>
<el-button icon="el-icon-search" circle></el-button>
<el-button type="primary" icon="el-icon-edit" circle></el-button>
<el-button type="success" icon="el-icon-check" circle></el-button>
<el-button type="info" icon="el-icon-message" circle></el-button>
<el-button type="warning" icon="el-icon-star-off" circle></el-button>
<el-button type="danger" icon="el-icon-delete" circle></el-button>
</el-row>
手机扫一扫
移动阅读更方便
你可能感兴趣的文章