switch函数

handleTabChange = key => {

    const { dispatch, match } = this.props;

    switch (key) {

      case 'articles':

        dispatch(routerRedux.push(`${match.url}/articles`));

        break;

      case 'applications':

        dispatch(routerRedux.push(`${match.url}/applications`));

        break;

      case 'projects':

        dispatch(routerRedux.push(`${match.url}/projects`));

        break;

      default:

        break;

    }

  };

你可能感兴趣的:(switch函数)