Skip to content
New issue

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

添加代理函数_proxyAttribbute。代理vm.$options.methods 到vm上 #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chenzewang
Copy link

代理vm.$options.methodsvm上,不然watch里面不能以this.clickBtn获取到在methods里定义的clickBtn方法。
image

this.$options.methods.clickBtn获取的话clickBtn里的this指向就变了

get: function proxyGetter() {
return source[key];
},
set: function proxySetter(newVal) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不需要set

Copy link
Owner

@DMQ DMQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

另外,需要加上methods的代理,在compile.js 事件处理的地方请一起优化掉,并整体测试下代码,有没有问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants