1. 程式人生 > >vue--1.環境搭建及建立專案

vue--1.環境搭建及建立專案

轉自https://blog.csdn.net/junshangshui/article/details/80376489

一.環境搭建及建立專案

1.安裝node.js,webpack

2.安裝vue腳手架cli

   npm install vue-cli –g

3.新建專案

   vue init webpack vue-hello

   其中需要用上下鍵選擇(選擇上面預設的那條)

4.切換到專案目錄安裝專案依賴項(即生成node_modules資料夾)

   cd vue-hello

   npm install

5.執行專案,http://localhost:8080地址訪問

   npm run dev

 

二.vscode中配置相關外掛

1.安裝vetur外掛,是vue語法的高亮外掛。
2.安裝eslint外掛,是智慧錯誤檢測外掛。

3.通過左邊拓展-搜尋進行安裝。

4.安裝後進行如下設定,檔案--首選項--設定--使用者設定

    "emmet.syntaxProfiles": {
        "vue-html": "html",
        "vue": "html"
    },
    
    "eslint.validate
": [ "javascript", "javascriptreact", "html", "vue" ], "eslint.options": { "plugins": ["html"] }