Vue2.0 新手攻略—从环境搭建到发布

1.vue是一个前端框架

  特点:

    1.数据绑定(在页面上进行输入input v-model=‘msg’,绑定到页面代码msg:‘hello’,js的变动绑定到页面上{{msg}},)

    2.组件化

    3.灵活的指令、操作页面。它本身强调的是组件化

2.*.vue文件

包括3部分:<template></template> 写html

      <script></script> js

      <style></style>  css

一个组件就是一个vue

3.安装

npm install webpack -g

  

npm install vue-cli -g

  在硬盘上找到一个文件夹用于放项目

vue init webpack my-project

  

npm install

  

npm run dev

  安装插件

npm install vue-router vue-resource --save

  

原文地址:https://www.cnblogs.com/songrimin/p/6866903.html