Commit fd9f9740 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫
parents 69f46193 dfcc4d6d
......@@ -14,18 +14,22 @@ interface CollectionPropsType {
const Collection: React.FC<CollectionPropsType> = (props) => {
const { query: { type } } = props.location
const [defaultTab, setDefaultTab] = useState<string>("commodity")
const [tabKey, setTabKey] = useState<string>("commodity")
useEffect(() => {
if (type) {
setDefaultTab(type)
setTabKey(type)
}
}, [type])
const handleChange = (key) => {
setTabKey(key)
}
return (
<PageHeaderWrapper>
<div className={styles.collection_wrap}>
<Tabs activeKey={defaultTab} className={styles.collection_tabs} >
<Tabs activeKey={tabKey} className={styles.collection_tabs} onChange={handleChange} >
<TabPane tab="商品收藏" key="commodity">
<Commodity />
</TabPane>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment