css - 带有 Bootstrap 4.0 alpha 布局的 React-big-calendar 丑陋

标签 css twitter-bootstrap reactjs bootstrap-4 react-big-calendar

我使用的是 bootstrap 4.0 alpha,没有其他样式。布局非常丑陋,日历只显示一列而不是表格。知道为什么以及如何做吗?

我从网站上注意到以下内容,但我不明白我应该怎么做:

note: The default styles use height: 100% which means your container must set an explicit height (feel free to adjust the styles to suit your specific needs).

这是我的渲染代码:

    render() {
    return (
        <div className="container">
            <TaskSearchBar
                search={this.onSearch}
            />
            <BigCalendar
                selectable
                events={[]}
                defaultView='week'
                scrollToTime={new Date(1970, 1, 1, 6)}
                defaultDate={new Date(2015, 3, 12)}
                onSelectEvent={event => alert(event.title)}
                onSelectSlot={(slotInfo) => alert(
                    `selected slot: \n\nstart ${slotInfo.start.toLocaleString()} ` +
                    `\nend: ${slotInfo.end.toLocaleString()}`
                )}
            />
            <TaskList
                queryUrl={this.state.queryUrl}
            />
        </div>
    );
}

这是布局结果 layout result

最佳答案

我发现我错过了这一行:

require('react-big-calendar/lib/css/react-big-calendar.css');

感谢enter link description here

关于css - 带有 Bootstrap 4.0 alpha 布局的 React-big-calendar 丑陋,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46020823/

相关文章:

html - 为什么任何 html 元素都需要 'padding' & 'border' ?

javascript - iframe 中的响应式网站

php - PHP 中的通用 header 存在多个 CSS 样式表问题

html - 为什么 marquee 标签在 google chrome 中不起作用?

javascript - React.js 框架中的 Mixin 是什么?

javascript - 尝试导入错误: 'ApiRequests' is not exported from './ApiRequests'

html - 导航栏 : home page on the left hand side with the same height

html - Bootstrap 导航栏中的搜索框向下跳转一行

html - 内容不在 2 列页面上的正确列中

javascript - 如何在同构应用程序中通过 Node 获取传递请求 cookie?