【发布时间】:2020-10-06 08:57:41
【问题描述】:
我是 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
【问题讨论】:
标签: javascript html css visual-studio-code frontend