是ko.applyBindings同步还是异步? [英] is ko.applyBindings synchronous or asynchronous?
问题描述
在调用ko.applyBindings()
之后生成的视图是否存在,还是脚手架是异步发生的?
Does the generated view exists right after you call ko.applyBindings()
or does the scaffolding happen asynchronously?
谢谢!
推荐答案
ko.applyBindings
是同步调用.
在某些情况下,绑定具有特殊的代码可以在setTimeout中执行操作,但通常情况并非如此.
There may be cases where bindings have special code to do things in a setTimeout, but this is not generally the case.
在
With the addition of components in Knockout 3.2, components are asynchronous. With Knockout 3.3, there will be an option to render components synchronously if the viewmodel / template is loaded.
这篇关于是ko.applyBindings同步还是异步?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!