2017-02-03 2 views
0

저는 scalajs-react를 사용하고 있습니다. DOM에서 제거하는 대신 부트 스트랩 경고를 숨기고 싶습니다. 은 내가 잘못 번역이 자바 스크립트 코드 herescalajs-react에서 경고 숨기기

$('.alert .close').on('click', function() { 
 
    $(this).parent().hide(); 
 
})

있는 다음 코드로 scalajs을-반응 :

.componentDidMount(scope => Callback { 
    jQuery(scope.getDOMNode()).on("click", null, null, Alert.closed _) 
    } 

명백한 문제가 경고 할 때 숨 깁니다이다 나는 단추의 아무 곳이나 클릭한다. 이 $ ('. alert .close')는 어떻게 번역 할 수 있습니까?

답변

0

나는 on() 메서드에서 선택기가 누락되었습니다. 해결책은 다음과 같습니다 :

jQuery(scope.getDOMNode()).on("click", ".close", null, Alert.closed _)