js implements Chinese sorting by pinyin, compatible with IE, Firefox, chrome

function sortBySpell(arr){

  return arr .sort(function(a,b){return a.localeCompare(b, 'zh-Hans-CN', {sensitivity: 'accent'})});

}

Test: sortBySpell(['Hello Buddha','Amitabha','Haha','Hot Wind'])

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324822073&siteId=291194637