我是新手,学习JS。我创建了一个带有复选框行的表格。现在我想对它进行测试。但是我的index.js文件出现了错误。
我的代码
import React from 'react';
import { Spin, Table } from 'antd';
import { useFetch } from 'innroad.common.ui';
import * as apiService from 'services/ApiService';
const AccountType = (onSelectingItems) => {
const [data, isLoading] = useFetch(apiService.accountType);
return (
<Spin spinning={isLoading}>
<Table
key="id"
bordered="true"
rowKey="id"
dataSource={data}
rowSelection={{ onChange: onSelectingItems }}
pagination={false}
>
<Table.Column title="Account Type" dataIndex="accountType" />
</Table>
</Spin>
);
};
/* AccountType.propTypes = {
selectionType: PropTypes.string,
onSelectingLineItems: PropTypes.func,
}; */
AccountType.defaultProps = {
selectionType: 'checkbox',
onSelectingLineItems: () => { },
};
export default AccountType;
还有一个问题:我应该使用注释块中的 AccountType.propTypes 吗?如果是,我需要如何更改它?因为现在我在这个块中得到一个错误——我声明了但没有使用。
Index.JS(这里出错了)
export { default } from './AccountType';
预期换行符为'LF',但发现'CRLF'. 在 ";" 后的eslintlinebreak-style。