The Vue Instance

参考文章:https://vuejs.org/v2/guide/instance.html

一、Constructor构造函数

    每一个 Vue应用是由带有一个构造函数Vue建立一个root Vue 实例,建立实例后,就开始启动一个应用。

     
     
var vm = new Vue({
// options
})

  尽管没有严格按照 MVVM pattern, Vue’s 设计者部分的受它启发。像传统一样, 我们经常使用变量vm (short for ViewModel) 指向我们的 Vue instance.

        Model–view–viewmodel (MVVM) is a software architectural pattern.

   

       当你建立一个Vue instance,你需要传递一个options object,这个选项对象包含数据,模板, element to mount on, 方法, 生命周期callbacks, and more. The full list of options can be found in the API reference.

The Vue 构造函数能被继承去建立重用的许多组件构造函数can be extended to create reusable component constructors with pre-defined options:


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值