webstorm + React + antd 声明一个数组类型,在使用时提示无法注入此类型 Initializer type
和官网上的写法一模一样呀,tsconfig.json也是脚手架里自带的没有修改过,是什么问题呢?
import type { ProColumns } from '@ant-design/pro-components';
import type { ActionType, ProColumns } from '@ant-design/pro-components';
export default ()=> {
type RoleData = {
name: string
}
const roleColumns: ProColumns<RoleData>[] = [{
title: '角色名称',
dataIndex: 'name',
},
{
title: '创建时间',
dataIndex: 'createTime'
}, {
title: '备注',
dataIndex: 'remark',
}]
return (
<></>
)
}
wu