1.Cd 到新建文件夾下 vue
2.Vue init webpack 文件名webpack
記到cd到文件名下面web
3.安裝json和resource和routervue-router
npm install vue-router vue-resource --save數據庫
npm install json-server --savenpm
環境搭建好以後每次打開項目記得npm run devjson
安裝數據庫app
Npm install json-server –-savevue-resource
原來文件:jsonp
改爲如今的
新建一個以db.json命名的文件
數據官網http://jsonplaceholder.typicode.com/
打開服務:Npm run json:server
Container 樣式居中
配置路由:
首頁
app頁面
添加數據頁面