1、安裝cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
2安裝webpack
cnpm install webpack -g
3、安裝vue腳手架
npm install vue-cli -g
4、安裝項目依賴
一定要從官方倉庫安裝,npm 服
cnpm install
5、啟動項目
npm run dev
這是瀏覽器輸入localhost:8080就會看到我們的項目。
可以適當(dāng)?shù)脑趇ndex.html里進(jìn)行修改,因為是熱部署的,所以改完立即生效。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>hello-vue3</title>
</head>
<body>
<h1>Hello World</h1>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

Paste_Image.png
附:
-
更新vue-cli
cnpm update vue-cli