数据绑定初始值设定项:它们接收属性的数组? [英] data binding initializers: they receive arrays dor the properties?

查看:67
本文介绍了数据绑定初始值设定项:它们接收属性的数组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。

愚蠢的问题:如果绑定中使用的初始化函数只能接收一个属性(至少,我找不到传递它的方法)几个属性和相应的值),为什么它继续接收源和目标属性的数组
(数组的第二个和第四个参数)?

stupid question: if the initializer function used in a binding can only receive one property (at least, I couldn't find a way to pass it several properties and corresponding values), why does it keep receiving arrays for origin and destination properties (second and fourth arguments of the array)?

还有一个问题:为什么这个初始化器而不是转换器???我的意思是,每当源的值发生变化时都应该调用它,而不仅仅是在初始化期间!

one more question: why is this an initializer and not a converter??? I mean, it should be called whenever the value of source changes and not only during initialization!

并忍受我:为什么绑定在使用初始化程序后不再更新值?下午,这是我正在使用的代码。

and bear with me: why does the binding no longer updates the value after using an initializer? Btw, heres the code I'm using.

标记:

< div id =" informacao" data-win-bind =" innerHTML:nome Livro.conversor">< / div>

< button> Muda nome para Pedro< / button>

<div id="informacao" data-win-bind="innerHTML: nome Livro.conversor"></div>
<button>Muda nome para Pedro</button>

javascript:

javascript:

注意删除绑定初始化程序确实更新了div的内容

notice that removing the binding initializer does indeed update the contents of the div

Luis Abreu

Luis Abreu







推荐答案

你好Luis,

1. 转换器将处理绑定到元素的数据。

1.  Converters will work on the data that is bound to the element.

2. 你无法传递数组

2.  You cannot pass arrays

这样做了吗回答你的问题?

Did that answer your questions?

-Jeff


这篇关于数据绑定初始值设定项:它们接收属性的数组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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