mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-12 12:54:48 +08:00
52 lines
1.3 KiB
JavaScript
52 lines
1.3 KiB
JavaScript
import React, { Component } from 'react'
|
|
import PropTypes from 'prop-types'
|
|
import { Route, Switch, Redirect } from 'react-router-dom';
|
|
import { Subnav } from '../../components/index'
|
|
import { Interface } from './Interface/Interface.js'
|
|
import { Activity } from './Activity/Activity.js'
|
|
import { Setting } from './Setting/Setting.js'
|
|
|
|
export default class GroupList extends Component {
|
|
|
|
static propTypes = {
|
|
match: PropTypes.object
|
|
}
|
|
|
|
state = {
|
|
}
|
|
|
|
constructor(props) {
|
|
super(props)
|
|
}
|
|
|
|
componentWillMount() {
|
|
}
|
|
|
|
render () {
|
|
const { match } = this.props;
|
|
console.log('project')
|
|
return (
|
|
<div>
|
|
<Subnav
|
|
default={'接口'}
|
|
data={[{
|
|
name: '接口',
|
|
path: `/project/${match.params.id}/interface`
|
|
}, {
|
|
name: '设置',
|
|
path: `/project/${match.params.id}/setting`
|
|
}, {
|
|
name: '动态',
|
|
path: `/project/${match.params.id}/activity`
|
|
}]}/>
|
|
<Switch>
|
|
<Redirect exact from ="/project/:id" to={`/project/${match.params.id}/activity`}/>
|
|
<Route path="/project/:id/activity" component={Activity} />
|
|
<Route path="/project/:id/interface" component={Interface} />
|
|
<Route path="/project/:id/setting" component={Setting} />
|
|
</Switch>
|
|
</div>
|
|
)
|
|
}
|
|
}
|