小编Ima*_*sal的帖子

如何在多个页面中使用 react joyride

有没有办法在多个页面中创建react-joyride之旅。所以我的 index.js 文件如下所示?我在索引页面中添加了 react-joyride,因为所有组件都通过 index.js 文件运行。

class IndexApp extends Component {
  constructor(props) {
    super(props);

    this.state = {
      view: false,
      run: true,
      steps: [
      {
        target: '.cc',
        content: 'This is my awesome feature!',
      },
    ],
    stepIndex: 0
    };
  }

  handleJoyrideCallback = data => {
    const { action, index, status, type } = data;
console.log("ghgg")
    if ([EVENTS.STEP_AFTER, EVENTS.TARGET_NOT_FOUND].includes(type)) {
      // Update state to advance the tour
      this.setState({ stepIndex: index + (action === ACTIONS.PREV ? -1 : 1) });
    }
    else …
Run Code Online (Sandbox Code Playgroud)

reactjs zurb-joyride

5
推荐指数
1
解决办法
703
查看次数

标签 统计

reactjs ×1

zurb-joyride ×1