- 源码地址:
https://github.com/liuyangjike/react-guide
参考网址:https://juejin.im/post/5ca859ccf265da30b53ed07b
import React, { Component } from "react";
import Guide from 'react-guide'
class App extends Component {constructor () {super()this.state = {visible: false}}handleStart() {this.setState({visible: true})}handleCancel() {this.setState({visible: false})}render() {return (<div><Guide visible={this.state.visible} onCancel={this.handleCancel.bind(this)} ><h1 data-step="1" data-tip='Hello World'>Step1</h1><div data-step="3" data-tip='Welcome to use react-guide'>Step3</div><h4 data-step="2" data-tip='react-guide is very easy' >Step2</h4><div><span data-step="4" data-tip='Let start'>Step4</span></div></Guide><button onClick={this.handleStart.bind(this)}>start</button></div>);}
}
export default App;