在ant design 中使用 sortOrder对table 进行降序排序报错 (使用typescript)
colums 的设置如下:
{
title: '营业额',
dataIndex: 'turnover',
key: 'turnover',
sortOrder: 'descend',
sorter: (a, b) => a.turnover - b.turnover,
},
错误信息:
Types of property 'sortOrder' are incompatible.
Type 'string' is not assignable to type '"descend" | "ascend" | undefined'.
官网文档描述如下: