Commit a9864947 by wangshuo

tab bug修改部分

parent 22a2b500
...@@ -44,6 +44,10 @@ class OutLine extends Component { ...@@ -44,6 +44,10 @@ class OutLine extends Component {
}) })
} }
change = (index) => {
console.log(index);
}
render() { render() {
const tabs = [ const tabs = [
{title: '介绍'}, {title: '介绍'},
...@@ -57,6 +61,15 @@ class OutLine extends Component { ...@@ -57,6 +61,15 @@ class OutLine extends Component {
<div className='course-detail'> <div className='course-detail'>
<WhiteSpace/> <WhiteSpace/>
<StickyContainer> <StickyContainer>
<div className='detail_tab'>
{
tabs.map((item, index) => {
return <div onClick={e => change(index)} className="tabItem" key={index}>
<span>{item.title}</span>
</div>
})
}
</div>
<Tabs tabs={tabs} <Tabs tabs={tabs}
initialPage={0} initialPage={0}
swipeable={false} swipeable={false}
......
...@@ -185,4 +185,25 @@ ...@@ -185,4 +185,25 @@
background-color: $bg_FE2F2F; background-color: $bg_FE2F2F;
} }
} }
.detail_tab {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
height: 46px;
.tabItem {
display: flex;
justify-content: center;
align-items: center;
width: 50%;
span {
display: inline-block;
height: 100%;
border-bottom: 1px solid #09f;
padding: 6px 0;
}
}
}
} }
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