前提需安裝node.js和Vue CLI
node.js:https://nodejs.org/zh-cn
Vue CLI:
npm install -g @vue/cli
如何創(chuàng)建一個(gè)vue2項(xiàng)目
(1) 使用cmd終端直接創(chuàng)建
進(jìn)入到vue項(xiàng)目所創(chuàng)建的目錄里(我是直接創(chuàng)建在桌面上)
?選擇vue2
創(chuàng)建項(xiàng)目 完成,發(fā)現(xiàn)npm run serve運(yùn)行后會(huì)報(bào)錯(cuò)
出現(xiàn)Conflict: Multiple assets emit different content to the same filename index.html
?此時(shí)此刻不要慌!
第一步:把index.html重命名為index.ejs
第二部:在node_nodules/webpack/bin/webpack.js中加入? html: { template: './src/index.ejs' }
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-603154.html
?文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-603154.html
到了這里,關(guān)于如何創(chuàng)建vue2,vue3項(xiàng)目的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!