OpenAnts基于 ElementUI 的 VUE 組件庫
OpenAnts 是基于 ElementUI 的 VUE 組件庫。
截圖
安裝
npm install openants -S
or
yarn add openants
快速開始
OpenAnts組件是基于Element開發(fā),所以在你安裝安裝OpenAnts我們將自動幫你安裝ElementUI,而無需你自己安裝,我們建議elementUI全局引入!
全局使用OpenAnts
main.js中的配置
import Vue from 'vue';
import ElementUI from 'element-ui'; // 需要引入 element-ui
import 'element-ui/lib/theme-chalk/index.css'; // 需要引入 element-ui 的主題文件
import OpenAnts from 'openants'; // 需要引入 OpenAnts
import "openants/lib/openants.css"; // 需要引入 OpenAnts 的 css文件
import App from './App.vue';
Vue.use(ElementUI); // 將 ElementUI 組件注冊到VUE
Vue.use(OpenAnts); // 將 ElementUI OpenAnts
new Vue({
el: '#app',
render: h => h(App)
});
按需使用OpenAnts
main.js中的配置
import Vue from 'vue';
import ElementUI from 'element-ui'; // 需要引入 element-ui
import 'element-ui/lib/theme-chalk/index.css'; // 需要引入 element-ui 的主題文件
import {btn,xxx} from 'openants'; // 需要引入 OpenAnts
import "openants/lib/openants.css"; // 需要引入 OpenAnts 的 css文件
import App from './App.vue';
Vue.use(ElementUI); // 將 ElementUI 組件注冊到VUE
Vue.component(btn.name, btn);
Vue.component(xxx.name, xxx);
/* 或?qū)憺?
* Vue.use(btn)
* Vue.use(xxx)
*/
new Vue({
el: '#app',
render: h => h(App)
});
完整教程
http://docs.unpor.com/docs/openants_for_vue/openants_for_vue-1c9f9qf36cnl9
評論
圖片
表情
