【发布时间】:2016-07-30 00:47:05
【问题描述】:
由于某种原因,小墨条不会出现在此选项卡下,它可能是 CSS 的东西,但我无法弄清楚,可能缺少一些我也不知道的东西,我一直在拉我的头发掉了,但我认为标签高度可能太高了?我不确定是否诚实,正在寻求帮助。
_getTabs() {
let styles = {
root: {
backgroundColor: '#333',
position: 'fixed',
height: 64,
top: 0,
right: 0,
zIndex: 0,
width: '100%',
},
container: {
position: 'absolute',
right: (Spacing.desktopGutter/2) + 48,
bottom: 0,
},
span: {
color: white,
left: 65,
top: 18,
position: 'absolute',
fontSize: 26,
},
svgLogoContainer: {
position: 'fixed',
width: 300,
left: Spacing.desktopGutter,
},
svgLogo: {
width: 65,
height: 65,
backgroundColor: '#333',
position: 'absolute',
top: 0,
},
tabs: {
width: 600,
bottom:0,
height: 64
},
tab: {
height: 64,
backgroundColor: '#333'
},
};
let renderedResult;
let loggedIn = false
let materialIcon = this.state.tabIndex !== '0' ? (
<EnhancedButton
style={styles.svgLogoContainer}
href="/">
<span style={styles.span}>MobaRedux</span>
</EnhancedButton>) : null;
if (loggedIn) {
renderedResult = (
<Paper zDepth={0}
rounded={false}
style={styles.root}
>
{materialIcon}
<div style={styles.container}>
<Tabs
style={styles.tabs}
value={this.state.tabIndex}
onChange={this._handleTabChange}
inkBarStyle={{backgroundColor:"#FFC107"}}>
<Tab
value="8"
label="DASHBOARD"
style={styles.tab}/>
<Tab
value="5"
label="ABOUT"
style={styles.tab} />
</Tabs>
</div>
</Paper>
);
}
else {
renderedResult = (
<Paper zDepth={0}
rounded={false}
style={styles.root}
>
{materialIcon}
<div style={styles.container}>
<Tabs
style={styles.tabs}
value={this.state.tabIndex}
onChange={this._handleTabChange}
inkBarStyle={{backgroundColor:"#FFC107"}}>
<Tab
value="8"
label="DASHBOARD"
style={styles.tab}
/>
<Tab
value="5"
label="ABOUT"
style={styles.tab}
/>
</Tabs>
</div>
</Paper>
);
}
return (
<div>
{renderedResult}
</div>
);
}
下面的蓝色标签是我只是在测试这些标签是否能正常工作
【问题讨论】:
-
似乎是这样,它的 this._handleTabChange,用于移除墨条的选项卡的 onChange 属性,尚不知道为什么。
标签: css reactjs material-ui