Vue组件库Element-ui
Element
是一套为开发者、设计师和产品经理准备的基于Vue2.0的桌面端组件库。Element - 网站快速成型工具
安装element-ui
npm install element-ui # element-ui@版本(可以指定版本号
引入ElementUI组件库,在main.js
中添加内容得到:
import Vue from 'vue'
import App from './App.vue'
import router from './router'
// 引入element-ui
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';Vue.config.productionTip = false// 使用element-ui
Vue.use(ElementUI);
new Vue({router,render: h => h(App)
}).$mount('#app')
在App.vue中进行修改如下:
<template><div><ElementView></ElementView></div>
</template><script>
import ElementView from './views/ElementView.vue';export default {components: {ElementView},data() {return {msg: 'Welcome to Your Vue.js App'}},mounted() {console.log('App.vue mounted');}
}
</script>
<style>
#app {font-family: Avenir, Helvetica, Arial, sans-serif;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;text-align: center;color: #2c3e50;
}nav {padding: 30px;
}nav a {font-weight: bold;color: #2c3e50;
}nav a.router-link-exact-active {color: #42b983;
}
</style>