forked from Gitlink/forgeplus-react
59 lines
1.1 KiB
JavaScript
59 lines
1.1 KiB
JavaScript
import React, { Component } from 'react';
|
||
|
||
import MenuWraps from '../MenuComponent/Menu';
|
||
import MyTopicItem from './MyTopicItem';
|
||
|
||
import './myExchange.css';
|
||
|
||
|
||
const menu_nav = [
|
||
{
|
||
name:"发表的话题",
|
||
key:`published`,
|
||
content:MyTopicItem
|
||
},
|
||
{
|
||
name:"回复的话题",
|
||
key:`replied`,
|
||
content:MyTopicItem
|
||
},
|
||
{
|
||
name:"看过的话题",
|
||
key:`watched`,
|
||
content:MyTopicItem
|
||
}
|
||
]
|
||
class MyTopic extends Component {
|
||
constructor(props){
|
||
super(props);
|
||
this.state={
|
||
activeKey:"published"
|
||
}
|
||
}
|
||
|
||
// 切换第2个nav:发表的话题、回复的话题、看过的话题
|
||
changeTab=(activeKey)=>{
|
||
this.setState({
|
||
activeKey
|
||
})
|
||
}
|
||
render(){
|
||
let { activeKey } = this.state;
|
||
return(
|
||
<div>
|
||
<MenuWraps
|
||
{...this.props}
|
||
{...this.state}
|
||
className="plate-left-Menu"
|
||
subActiveKey={activeKey}
|
||
menu_nav={menu_nav}
|
||
defaultUrlKey={activeKey}
|
||
changeTab={this.changeTab}
|
||
urlName={'my_memos'}
|
||
/>
|
||
</div>
|
||
)
|
||
}
|
||
}
|
||
|
||
export default MyTopic;
|