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

bue/src/directives/repeat.js有一个小小的疑问。 #5

Open
LiuMengzhou opened this issue Aug 17, 2017 · 2 comments
Open

bue/src/directives/repeat.js有一个小小的疑问。 #5

LiuMengzhou opened this issue Aug 17, 2017 · 2 comments

Comments

@LiuMengzhou
Copy link

exports.getVm = function (data) {
return data[this.id];
};

exports.cacheVm = function (data, vm) {
data[this.id] = vm;
};

此时this.id为什么可以获得repeat实例的id,我理解现在this不是指向现在的模板吗?请大佬解释下。

@zyl1314
Copy link
Contributor

zyl1314 commented Aug 18, 2017

@LiuMengzhou this是Directive实例

@LiuMengzhou
Copy link
Author

@zyl1314 明白了,谢谢。

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

No branches or pull requests

2 participants