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

查看:25
本文介绍了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.

Knockout 3.2,组件是异步的.在 Knockout 3.3 中,如果加载了视图模型/模板,将有一个选项可以同步渲染组件.

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天全站免登陆