在 vscode 中創(chuàng)建 vue 項(xiàng)目的方法:安裝 Vue CLI;創(chuàng)建新項(xiàng)目(vue create my-vue-project);選擇項(xiàng)目模板;輸入項(xiàng)目名稱和選項(xiàng);安裝依賴項(xiàng)(cd my-vue-project && npm install);運(yùn)行項(xiàng)目(npm run serve);在瀏覽器中打開(kāi)項(xiàng)目(http://localhost:8080)。
如何在 VSCode 中創(chuàng)建 Vue 項(xiàng)目
步驟 1:安裝 Vue CLI
- 打開(kāi)終端或命令提示符。
- 運(yùn)行以下命令:
npm install -g @vue/cli
步驟 2:創(chuàng)建新項(xiàng)目
- 導(dǎo)航到要保存項(xiàng)目的目錄。
- 運(yùn)行以下命令:
vue create my-vue-project
步驟 3:選擇項(xiàng)目模板
立即學(xué)習(xí)“前端免費(fèi)學(xué)習(xí)筆記(深入)”;
- 選擇默認(rèn)模板(手動(dòng)選擇其他模板)。
步驟 4:輸入項(xiàng)目名稱和選項(xiàng)
步驟 5:安裝依賴項(xiàng)
- 運(yùn)行以下命令安裝項(xiàng)目依賴項(xiàng):
cd my-vue-project npm install
步驟 6:運(yùn)行項(xiàng)目
- 運(yùn)行以下命令啟動(dòng)開(kāi)發(fā)服務(wù)器:
npm run serve
步驟 7:打開(kāi)項(xiàng)目
- 在瀏覽器中打開(kāi)以下地址:
http://localhost:8080
您現(xiàn)在已經(jīng)成功在 VSCode 中創(chuàng)建了一個(gè) Vue 項(xiàng)目。
? 版權(quán)聲明
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載。
THE END
喜歡就支持一下吧
相關(guān)推薦