gulp를 사용하여 JSX를 빌드하고 있습니다.reactjs : nth-child의 대안 (jsx가 제대로 "자식이 정의되지 않았습니다")
this.setState({exceptionsEdit: manual_exceptions}, function(){
this.state.exceptionsEdit.forEach(function (exp, index){
$('#exception-list-edit').nth-child(index).find('.ui-slider').slider("values", 0, Date.parse(this.state.exceptionsEdit[index].start)/1000)
$('#exception-list-edit').nth-child(index).find('.ui-slider').slider("values", 1 , Date.parse(this.state.exceptionsEdit[index].end)/1000)
})
})
내가 exceptionsEdit
의 상태를 설정 한 후 일부 jQuery를 실행하고 있습니다 :
은 지금부터 내가 가진 어떤 jQuery를 사용하는 코드를 반응한다. 하지만 내 페이지를로드 할 때 다음과 같은 오류가 나타납니다.
Uncaught ReferenceError: child is not defined
$('#exception-list-edit').nth - child(index).find('.ui-slider').slider("values", 0, Date.parse(this.state.exceptionsEdit[index].start)/1000);
어떻게해야합니까? n 번째 아이를 사용하지 않아야합니까? jsx/친화적 인 대안이 있습니까?
으로해야한다고 생각. 귀하가 달성하고자하는 최종 목표는 무엇입니까? 마찬가지로, 어떤 기능이 필요합니까? – erichardson30
@ erichardson30 이해합니다. 하지만이 UI 슬라이더는 jquery 라이브러리입니다. 이 슬라이더는 규칙의 예외이며 사용해야합니다. 나는 단순히 슬라이더 nob 값을 업데이트하려고합니다. – ApathyBear