Skip to content

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.

2 participants