關於vue.js
vue.js是一套構建用戶界面的 輕型的漸進式前端框架。它的目標是經過儘量簡單的 API 實現響應的數據綁定和組合的視圖組件。使用vue能夠給你的開發帶來極致的編程體驗。html
關於vue-cli
Vue-cli是vue官方提供的一個命令行工具(vue-cli),可用於快速搭建大型單頁應用。該工具提供開箱即用的構建工具配置,帶來現代化的前端開發流程。只需一分鐘便可啓動帶熱重載、保存時靜態檢查以及可用於生產環境的構建配置的項目。前端
安裝vue-clivue
npm install -g vue-cli
使用vue-cli初始化項目webpack
vue init webpack my-project
進入到目錄web
cd my-project
安裝依賴vue-cli
npm install
開始運行npm
npm run dev
項目結構編程
├── build/ # webpack config files
│ └── ...
├── config/
│ ├── index.js # main project config
│ └── ...
├── src/
│ ├── main.js # app entry file
│ ├── App.vue # main app component
│ ├── components/ # ui components
│ │ └── ...
│ └── assets/ # module assets (processed by webpack)
│ └── ...
├── static/ # pure static assets (directly copied)
├── test/
│ └── unit/ # unit tests
│ │ ├── specs/ # test spec files
│ │ ├── index.js # test build entry file
│ │ └── karma.conf.js # test runner config file
│ └── e2e/ # e2e tests
│ │ ├── specs/ # test spec files
│ │ ├── custom-assertions/ # custom assertions for e2e tests
│ │ ├── runner.js # test runner script
│ │ └── nightwatch.conf.js # test runner config file
├── .babelrc # babel config
├── .editorconfig.js # editor config
├── .eslintrc.js # eslint config
├── index.html # index.html template
└── package.json # build scripts and dependenciesjson