gpt4 book ai didi

css - FIxedDataTable CSS 解析错误

转载 作者:太空宇宙 更新时间:2023-11-04 11:10:19 25 4
gpt4 key购买 nike

我正在尝试让示例代码正常工作但出现错误

代码

import React, {Component} from "react";
import FixedDataTable from "fixed-data-table";
import {Table, Column, Cell} from 'fixed-data-table';
import './fixed-data-table.css';
var rows = [
['a1', 'b1', 'c1'],
['a2', 'b2', 'c2'],
['a3', 'b3', 'c3']
// .... and more
];

class App extends Component {

constructor(props) {
super(props);
this.rowGetter = this.rowGetter.bind(this);
}



rowGetter(rowIndex) {
return rows[rowIndex];
}



render() {
return (
<Table
rowHeight={50}
rowGetter={this.rowGetter}
rowsCount={rows.length}
width={5000}
height={5000}
headerHeight={50}>
<Column
label="Col 1"
width={3000}
dataKey={0}
/>
<Column
label="Col 2"
width={2000}
dataKey={1}
/>
</Table>
);

}

}


export default App;

错误

Unexpected token (23:0)
21 | */
22 |
> 23 | .fixedDataTableCellGroupLayout_cellGroup {
| ^
24 | -webkit-backface-visibility: hidden;
25 | backface-visibility: hidden;
26 | left: 0;

固定数据表 https://facebook.github.io/fixed-data-table/

我正在使用 https://github.com/vasanthk/react-universal-starter作为种子元素。

我尝试根据 https://github.com/christianalfoni/react-webpack-cookbook/wiki/Loading-CSS 安装 css 加载器但没有运气

最佳答案

不要这样做:import './fixed-data-table.css';

您需要在 <head> 中导入该 css你的 html <link rel="stylesheet" type="text/css" href="fixed-data-table.css">

关于css - FIxedDataTable CSS 解析错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33669739/

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