下面的代码(来自om.next)创建了一个复选框输入。创建工作正常,但我不知道如何获得事件值,因为我单击它时没有在日志中看到该值(尽管有很多数据):
(dom/input #js {:type "checkbox"
:onClick (fn [e] (js/console.log e)) ;; how do I get the current true/false value from `e` ?
})我进入日志(缩写):
".0.0.1.$cardpath=1om_tutorial=1B_UI_Exercises=1exercise-3.0.$-184795562.1.0",SyntheticMouseEvent {dispatchConfig: Object,dispatchMarker: dispatchMarker nativeEvent: MouseEvent,target: input,currentTarget: input…}
注意:代码来自那里。
发布于 2016-01-28 15:44:31
(.- target e)返回元素,通常需要元素中的.-value,但是对于复选框,则需要.-checked .所以就像
(.. e -target -checked)https://stackoverflow.com/questions/35065755
复制相似问题