初学Vue.js(2.x版本)

首先肯定是打开官网查看文档了,没想到我太高估了自己,看的我头晕也不知道到底说了个啥。没办法,只能另寻他法,好在有菜鸟教程。然而我还是想多了,不稀饭一点点看下去,只想快点明白它到底说了个啥。嗯,找来找去找到了偶能理解的方式了(带着问题学起来轻松些,要不然会被脑子的各种疑问烦到啥都干不了)。每个人接收信息以及处理信息的方式都不同吧,找到适合自己的就行。好了,不废话了,进入正文:

  1. new Vue()这是干啥?
    1).啊,这个好猜,前面有关键字new,肯定是实例化类啊。文档里这样写的:

    2).new后面的格式明显像JSON数据格式啊,只不过键值没有加引号;
  2. el, data表示的又是啥?
    1).el后面的值明显表示的是div的id啊,后面修改成class名也可以,或者tagName(元素名称)也可以。那就是表示插入Vue值的父元素了,表现形式多样哈。看下人家官网文档的正宗解释:

    2).data里的数据可以输出到页面,那这里就是类的数据了,官网文档: data。我又看的头大,不管了,先理解到这里。
  3. {{message}}这是输出Vue的数据?
    好吧,这种双大括号的方式看着还没顺眼。人家这么定义的,你有什么疑问也没用。OK,下一题。看了下文档,偶浅显的理解为将Vue的数据插入到Html元素中的格式。官网文档:插值
  4. 什么是MVVM模式?
    找来找去,终于发现一篇浅显易懂的,虽然评论区有很多争论:MVC,MVP 和 MVVM 的图示
  5. 此次学习是基于2.x版本的,大概废除了1.0版本的某些操作,今天看友邻的文章时发现一些代码执行不了。比如单次插值,查看了下2.x版本的文档,果然没有讲解单次插值的知识。
 
小结:Vue.js就是通过特定的语法格式显示或操作html元素(先肤浅的理解到这里)。
发现有园友写的很好: http://www.cnblogs.com/rik28/p/6024425.html,不过感觉他学习的版本是1.0,有些在2.x版本中运行失效了。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Learn the fundamentals of vue.js by creating complex SPAs with Vuex, vue-router and more Key Features We bridge the gap between "learning" and "doing" by providing real-world examples that will improve your web development skills with Vue.js Explore the exciting features of Vue.js 2 through practical and interesting examples Explore modern development tools and learn how to utilize them by building applications with Vue.js Book Description Vue.js is a frontend web framework which makes it easy to do just about anything, from displaying data up to creating full-blown web apps, and has become a leading tool for web developers. This book puts Vue.js into a real-world context, guiding you through example projects that helps you build Vue.js applications from scratch. With this book, you will learn how to use Vue.js by creating three Single Page web applications. Throughout this book, we will cover the usage of Vue, for building web interfaces, Vuex, an official Vue plugin which makes caching and storing data easier, and Vue-router, a plugin for creating routes and URLs for your application. Starting with a JSON dataset, the first part of the book covers Vue objects and how to utilize each one. This will be covered by exploring different ways of displaying data from a JSON dataset. We will then move on to manipulating the data with filters and search and creating dynamic values. Next, you will see how easy it is to integrate remote data into an application by learning how to use the Dropbox API to display your Dropbox contents in an application In the final section, you will see how to build a product catalog and dynamic shopping cart using the Vue-router, giving you the building blocks of an e-commerce store. What you will learn Looping through data with Vue.js Searching and filtering data Using components to display data Getting a list of files using the dropbox API Navigating through a file tree and loading folders from a URL

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值