NativeScript MaskedInput数据绑定 [英] NativeScript MaskedInput databinding
问题描述
我正在尝试使用MaskedInput小部件( https://github.com/bthurlow/nativescript-maskedinput ),但我无法使数据绑定正常工作.这是我的代码:
I am trying to use the MaskedInput widget (https://github.com/bthurlow/nativescript-maskedinput) and I am having trouble getting the databinding to work. Here is my code:
<mi:MaskedInput mask="999 999 9999" placeholder="_" text="{{ customer.homephone }}" color="#a8b4b9" />
以上代码段最初不会显示电话号码.我很肯定customer.homephone的价值所在,因为
The above snippet does not display the phone number initially. I am positive the customer.homephone has value in it because
<TextField text="{{ customer.homephone, customer.homephone | phoneConverter() }}" class="value bold" />
正确显示它.如果我用硬编码值替换MaskedInput的text属性,则会显示该值.在我看来,数据绑定正在发生某些事情.我在这里想念什么吗?
displays it correctly. If I replace the text property of the MaskedInput with a hard-coded value, the value is displayed. It seems to me that there is something going on with the databinding. Am I missing something here?
任何想法都受到高度赞赏.
Any ideas are highly appreciated.
谢谢.
推荐答案
您做的正确,但是从我从该插件的代码中可以看到,它不支持数据绑定.
You are doing things correctly, but from what I see from the code of that plugin it does not support data binding.
这篇关于NativeScript MaskedInput数据绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!