ant-design-vue a-table 表格排序

数字类的排序

{
            id:'6',
            title: '累计充值月数',
            width:130,
            dataIndex: 'total_month',
            sorter: (a, b) => a.total_month - b.total_month,
          }

中文类的排序

{
            id:'10',
            width:140,
            title: '客户类型',
            dataIndex: 'customer_type',
              sorter: (a, b) => {
                let prev = a.customer_type ? a.customer_type : '';
                let next = b.customer_type ? b.customer_type : '';
                return prev.localeCompare(next, 'zh-Hans-CN', { sensitivity: 'accent' });
            },
          }

你可能感兴趣的:(vue.js,javascript,前端,ant-design-vue)