09 2020 档案
摘要:本文只分析了data中数据变为响应式对象,及修改触发dom更新的过程,computed和watch暂不讨论 一、Vue如何实现数据响应式 1、new Vue() 实例时,调用原型上_init() 方法 function Vue (options) { if (process.env.NODE_ENV
阅读全文
摘要:首先附上$mount相关源码 // runtime-only 和 runtime-compiler版本中$mount方法都需要执行的部分Vue.prototype.$mount = function ( el, hydrating ) { el = el && inBrowser ? query(e
阅读全文
摘要:先来一段vue代码 import Vue from 'vue' new Vue({ el: '#app', data: { message: 'hello world' }, mounted() { console.log(this.message) } }) 从源码理解 function Vue
阅读全文
浙公网安备 33010602011771号