3
introJs을 React와 함께 사용하려고하는데 작동하지 않는 것 같습니다. 어떻게 작동시킬 수 있습니까? 예를 들어 줄 수 있습니까?어떻게 인트로 js를 React와 함께 사용할 수 있습니까?
introJs을 React와 함께 사용하려고하는데 작동하지 않는 것 같습니다. 어떻게 작동시킬 수 있습니까? 예를 들어 줄 수 있습니까?어떻게 인트로 js를 React와 함께 사용할 수 있습니까?
지금,이 도움이 componentDidMount
class App extends React.Component{
componentDidMount(){
introJs().start()
}
render(){
return <div>
<a href='http://google.com/' data-intro='Hello step one!'>one</a>
<a href='http://google.com/' data-intro='Hello step two!'>two</a>
<a href='http://google.com/' data-intro='Hello step three!'>three</a>
<a href='http://google.com/' data-intro='Hello step four!'>four</a>
</div>
}
}
ReactDOM.render(<App/>, document.getElementById('app'))
a{
margin-left: 60px;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"></script>
<link href="https://cdn.jsdelivr.net/intro.js/2.3.0/introjs.min.css" rel="stylesheet"/>
<script src="https://cdn.jsdelivr.net/intro.js/2.3.0/intro.min.js"></script>
<div id="app"></div>
희망 내부 introJs().start()
를 호출하여 index.html
<link href="https://cdn.jsdelivr.net/intro.js/2.3.0/introjs.min.css" rel="stylesheet"/>
<script src="https://cdn.jsdelivr.net/intro.js/2.3.0/intro.min.js"></script>
에 다음을 추가하십시오!
감사합니다. 나는 거의 똑같이했으나 효과가 없었습니다. 이제 작동합니다. 고맙습니다. –
그게 무슨 뜻입니까? –
React와 완벽하게 통합 된 훌륭한 대체 라이브러리는 React Joyride입니다. https://gilbarbara.github.io/react-joyride/ – Mastergalen
관련 라이브러리 검색 ([this library] (https://github.com/elrumordelaluz/reactour) 완료)) –