knockoutjs 数据绑定 ="tap:controller.method.bind()" 未在 mobile/ipad 中触发
knockoutjs data-bind ="tap:controller.method.bind()" is not firing in mobile/ipad
我有 HTML 页面、不同的控制器和视图模型。在 html 文件中,我有一个按钮和点击事件,如下所示。
<a href="#" data-bind="visible: gameIsReady(),tap: controller.handleStartButtonClick.bind(controller),event:{ mousedown: $root.controller.buttonActivate.bind($root.controller),mouseup: $root.controller.buttonDeactivate.bind($root.controller)}"></a>
基于模板,事件触发特定的控制器和其中的方法。它在桌面上按预期工作。但是没有命中mobile/ipad.
中的方法
我是knockout Js新手。谁能告诉我这里出了什么问题?
提前致谢。
尝试像 mousedown
和 mouseup
那样使用 event
绑定
<a href="#" data-bind="visible: gameIsReady(), event:{ mousedown: $root.controller.buttonActivate.bind($root.controller), mouseup: $root.controller.buttonDeactivate.bind($root.controller), touchend: $root.controller.handleStartButtonClick.bind($root.controller) }"></a>
我有 HTML 页面、不同的控制器和视图模型。在 html 文件中,我有一个按钮和点击事件,如下所示。
<a href="#" data-bind="visible: gameIsReady(),tap: controller.handleStartButtonClick.bind(controller),event:{ mousedown: $root.controller.buttonActivate.bind($root.controller),mouseup: $root.controller.buttonDeactivate.bind($root.controller)}"></a>
基于模板,事件触发特定的控制器和其中的方法。它在桌面上按预期工作。但是没有命中mobile/ipad.
中的方法我是knockout Js新手。谁能告诉我这里出了什么问题?
提前致谢。
尝试像 mousedown
和 mouseup
event
绑定
<a href="#" data-bind="visible: gameIsReady(), event:{ mousedown: $root.controller.buttonActivate.bind($root.controller), mouseup: $root.controller.buttonDeactivate.bind($root.controller), touchend: $root.controller.handleStartButtonClick.bind($root.controller) }"></a>