npm install axioscss
在 main.js 中写入如下内容:vue
import Vue from 'vue';
import ElementUI from 'element-ui'; import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
import axios from 'axios' import VueAxios from 'vue-axios'
Vue.use(VueAxios, axios)
import App from './App.vue'; const originalPush = Router.prototype.push Router.prototype.push = function push(location) { return originalPush.call(this, location).catch(err => err) } new Vue({ el: '#app', render: h => h(App) });
以上代码便完成了 Element 的引入。须要注意的是,样式文件须要单独引入。node