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