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