如何使用CanJS进行双向绑定?
Enter the Text : <input type="text" name="name" can-value="enteredText" />
Display the Text: {{enteredText}}可以显示多个方法?使用ViewModel?
发布于 2017-06-03 03:22:56
can-value是v2中的旧方法。在Canjs 4.0中,你可以像这样做双向绑定:
Enter the Text : <input type="text" name="name" value:bind="enteredText" />
Display the Text: {{enteredText}}请参阅:https://canjs.com/doc/can-stache-bindings.twoWay.html
下面是一个演示语法的jsbin:
https://stackoverflow.com/questions/43351083
复制相似问题