const vueInstance = new Vue({
		el:'#app',
		data:{
			a:'name',
			b:'b',
			c:'c'}})Copy the code

vueInstance._data.a => vueInstance.a ? How to implement

Implement an MVVM data broker
const vm=new MVVM({
		el:'#app',
		data:{
			a:'name',
			b:'b',
			c:'c'}});function MVVM(options){
		this.$optionsVar data=this._data=this.$optionsIf ((key)=>{me._proxy(key)})} MVVM. Prototype = {_proxy:function(key){
			var me=this
			Object.defineProperty(me,key,{
				configurable:false// Enumerable cannot be redefined:true,// can be enumeratedget(){// Get this._data, return the data value of the parameterreturn me._data[key]
				},
				set(newVal){// Add a new value to this._data [key]=newVal}})}}Copy the code