1.環(huán)境搭建
具體環(huán)境搭建步驟參考鏈接
- 注意該博客中初始化命令:
vue init webpack MyPortalProject
需改為小寫:
vue init webpack myportalproject
不然會報錯
Warning: name can no longer contain capital letters
2.創(chuàng)建第一個vue+element ui項目
創(chuàng)建項目過程參考鏈接文章來源:http://www.zghlxwxcb.cn/news/detail-742525.html
- 此博客中示例代碼,運行后,按鈕樣式未生效,可在 main.js 中添加
Vue.use(ElementUI, {size:'mini', zIndex:1024})
main.js全部代碼如下:文章來源地址http://www.zghlxwxcb.cn/news/detail-742525.html
// 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/>'
})
到了這里,關于在windows中搭建vue開發(fā)環(huán)境的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!