1.环境搭建
具体环境搭建步骤参考链接
-
注意该博客中初始化命令:
vue init webpack MyPortalProject
需改为小写:
vue init webpack myportalproject
不然会报错
Warning: name can no longer contain capital letters
2.创建第一个vue+element ui项目
创建项目过程参考链接
-
此博客中示例代码,运行后,按钮样式未生效,可在 main.js 中添加
Vue.use(ElementUI, {size:'mini', zIndex:1024})
main.js全部代码如下:
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
/*引入如下组件*/
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
Vue.config.productionTip = false
Vue.use(ElementUI, {size:'mini', zIndex:1024})
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>'
})