reactjs - react/antd中的抽屉在右侧没有打开,就在所有组件的下方
问题描述
我希望当按下我的搜索按钮时,在右侧打开一个菜单,但它不服从,它在桌子下方打开
<div className='container-fluid'>
<Drawer
title="Teste"
closable={true}
onClose={this.onClose}
visible={this.state.displayDiv}
>
<p>Some contents...</p>
<p>Some contents...</p>
<p>Some contents...</p>
</Drawer>
<div className='row' style={{ marginLeft: 30 }}>
<button class='btn btn-outline-success' type='button' onClick={this.changeDiv} style={{ marginLeft: 20, height: 40 }}>
Pesquisar
</button>
</div>
<table>
{...}
</table>
</div>
我使用引导程序作为样式和 antd 作为组件
解决方案
有同样的问题。在调查时我发现我没有将我的 antd css 导入到我的 index.css 文件中。
这是我的 index.css 文件:
@import '~antd/dist/antd.css';
body {
margin: 0;
font-family: 'Arimo', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
推荐阅读
- java - 使用匿名比较器的 ArraySort 会出错
- reactjs - 反应原生视图不更新
- ffmpeg - ffmpeg 无法将 mp4 转换为 mp3 输出文件 #0 不包含任何流
- postgresql - “org.hibernate.PersistentObjectException:分离的实体传递给持久化”错误经过大量研发后没有得到解决
- swift - 核心数据数据删除
- jquery - 可变高度水平手风琴
- git - 每当在远程分支中完成 git 提交时,如何生成电子邮件?
- graphics - BlueSky Statistics 中的图形图像大小
- javascript - HTML 滚动到 div 菜单
- kentico - 电子邮件主题编码