CanJSを使用して双方向バインディングを行う方法は?CanJS - 双方向バインディング
Enter the Text : <input type="text" name="name" can-value="enteredText" />
Display the Text: {{enteredText}}
複数のアプローチを表示できますか? ViewModelを使用していますか?
CanJSを使用して双方向バインディングを行う方法は?CanJS - 双方向バインディング
Enter the Text : <input type="text" name="name" can-value="enteredText" />
Display the Text: {{enteredText}}
複数のアプローチを表示できますか? ViewModelを使用していますか?
can-value
はv2の古いメソッドでした。
Enter the Text : <input type="text" name="name" {($value)}="enteredText" />
Display the Text: {{enteredText}}
注value
前$
:Canjs 3.0では、あなたはこのように2つの結合方法を行うだろう。これは、あなたがdom要素にバインドしていることを表します。コンポーネント値にバインドしていた場合は、$を除外します。
参照:https://canjs.com/doc/can-stache-bindings.twoWay.html
はここ構文を実証jsbinです: