-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
ViewModel中vm作用域bug #6
Comments
其实是这样的,vm只是用来定义的,它与define 返回的对象不是同一个对象。而对视图进行绑定时,我们是用返回的login对象。 |
avalon.log(vm.user);//取不到值
avalon.log(login.user);//正常 我只能用login.user? |
是的,你这个是一个事件回调,this是指向绑定事件的元素节点;而它里面想指向viewModel,只能用avalon.define的返回值 |
我暂时还没有什么好办法来hack这个vm |
RubyLouvre
pushed a commit
that referenced
this issue
Feb 13, 2014
Merge pull request #5 from RubyLouvre/master
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
描述可能不准确,具体看代码
html 代码:
js 代码:
The text was updated successfully, but these errors were encountered: