yapi/client/containers/User/User.js

40 lines
847 B
JavaScript
Raw Normal View History

2017-07-17 11:01:05 +08:00
import './index.scss'
import React, { Component } from 'react'
import { connect } from 'react-redux'
2017-07-20 16:44:41 +08:00
import { Route, Redirect} from 'react-router-dom'
2017-07-17 11:01:05 +08:00
import LeftMenu from './LeftMenu.js'
import List from './List.js'
import PropTypes from 'prop-types'
import Profile from './Profile.js'
@connect()
class User extends Component {
static propTypes = {
match: PropTypes.object
}
constructor(props) {
super(props)
}
componentDidMount () {
console.log(this.props.match)
}
render () {
return (
<div>
<section className="user-box">
<LeftMenu />
<Route path={this.props.match.path + '/list'} component={List} />
<Route path={this.props.match.path + '/profile/:uid'} component={Profile} />
2017-07-17 11:01:05 +08:00
</section>
</div>
)
}
}
export default User