We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new Vue({ ..... data(){ return { a:1 } } })
// 4762行 proxy(vm, "_data", key);
vm为全局Vue
// sourceKey-> '_data' function proxy (target, sourceKey, key) { sharedPropertyDefinition.get = function proxyGetter () { return this[sourceKey][key] }; sharedPropertyDefinition.set = function proxySetter (val) { this[sourceKey][key] = val; }; Object.defineProperty(target, key, sharedPropertyDefinition);// target->vm, key->'a' }
当我们访问this.a时程序会走Object.defineProperty(target, key, sharedPropertyDefinition)中的get返回this[sourceKey][key],即this['_data']['a'],设置值也同理
The text was updated successfully, but these errors were encountered:
No branches or pull requests
vm为全局Vue
当我们访问this.a时程序会走Object.defineProperty(target, key, sharedPropertyDefinition)中的get返回this[sourceKey][key],即this['_data']['a'],设置值也同理
The text was updated successfully, but these errors were encountered: