用的是ant design 的table 想法是前端按照拼音对中文排序。排序函数官网就是这样写的。但是报错说TypeError: a.localeCompare is not a function。
该怎么修改。
columns = [
{
title: '公司名称',
dataIndex: 'companyname',
key: 'companyname',
sorter: (a, b) => a.localeCompare(b),
},
]
检查 a 的值是不是字符串