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
原来的方案
<!doctype html> <html > <head> <script src="avalon.js"></script> <script> var model = avalon.define("test", function(vm) { vm.aaa = 11111 vm.callback = function(a) { this.innerHTML = a } }) setInterval(function() { model.aaa = new Date - 0 }, 50) </script> </head> <body ms-controller="test"> <div ms-bind="aaa:callback">TEXT</div> </body> </html>
替换方案,使用$watch与ms-attr-id
<!doctype html> <html > <head> <script src="avalon.js"></script> <script> var model = avalon.define("test", function(vm) { vm.aaa = 11111 vm.$watch("aaa", function(e){ var el = document.getElementById("aaa") if(el){ el.innerHTML = e } }) }) setInterval(function() { model.aaa = new Date - 0 }, 50) </script> </head> <body ms-controller="test"> <div ms-attr-id="'aaa'">TEXT</div> </body> </html>
The text was updated successfully, but these errors were encountered:
出于什么考虑呢?
Sorry, something went wrong.
No branches or pull requests
原来的方案
替换方案,使用$watch与ms-attr-id
The text was updated successfully, but these errors were encountered: