是ko.applyBindings同步还是异步? [英] is ko.applyBindings synchronous or asynchronous?

查看:74
本文介绍了是ko.applyBindings同步还是异步?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在调用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.

组件 .knockmeout.net/2014/06/knockout-3-2-preview-components.html"rel =" nofollow>淘汰赛3.2 ,组件是异步的.使用Knockout 3.3,如果加载了viewmodel/模板,则可以选择同步渲染组件.

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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆