项目遇到排序需求,有数字需要自然排序
let collator = new Intl.Collator(undefined, {numeric: true, sensitivity: 'base'});
this.wardList.sort((a, b) => {
return collator.compare(a.wardName, b.wardName)
})
项目遇到排序需求,有数字需要自然排序
let collator = new Intl.Collator(undefined, {numeric: true, sensitivity: 'base'});
this.wardList.sort((a, b) => {
return collator.compare(a.wardName, b.wardName)
})