gpt4 book ai didi

reactjs - 我在 react-bootstrap-table-next 上没有边界

转载 作者:行者123 更新时间:2023-12-03 20:29:58 24 4
gpt4 key购买 nike

我以这种方式使用 react-bootstrap-table-next :

import React, { Component } from 'react';
import products from './data.js';
import 'react-bootstrap-table-next/dist/react-bootstrap-table2.min.css';
import BootstrapTable from 'react-bootstrap-table-next';

const columns = [{
dataField: 'id',
text: 'Product ID'
}, {
dataField: 'name',
text: 'Product Name'
}, {
dataField: 'price',
text: 'Product Price'
}];

class App extends Component {
render() {
return (
<BootstrapTable keyField='id' data={ products } columns={ columns } />
);
}
}

export default App;

但是,没有边界。

enter image description here

我缺少什么?

最佳答案

我有完全相同的问题。它需要像其他人提到的那样引导 CSS。在典型的 React 应用程序中,您需要安装 bootstrap通过 npm,然后使用这一行导入引导 CSS。

import 'bootstrap/dist/css/bootstrap.min.css';

关于reactjs - 我在 react-bootstrap-table-next 上没有边界,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51257468/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com