关于vue.js
vue.js是一套构建用户界面的 轻型的渐进式前端框架。它的目标是通过尽可能简单的 API 实现响应的数据绑定和组合的视图组件。使用vue可以给你的开发带来极致的编程体验。关于vue-cli
Vue-cli是vue官方提供的一个命令行工具(vue-cli),可用于快速搭建大型单页应用。该工具提供开箱即用的构建工具配置,带来现代化的前端开发流程。只需一分钟即可启动带热重载、保存时静态检查以及可用于生产环境的构建配置的项目。安装vue-cli
npm install -g vue-cli
使用vue-cli初始化项目
vue init webpack my-project
进入到目录
cd my-project
安装依赖
npm install
开始运行
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 dependencies