#鸿蒙通关秘籍#Array的sort排序方法,在NEXT0.0.31不生效,NEXT0.0.26以及之前都没问题

const Keyboard_ABC: Array<Array<KeyboardItemData>> = [

[

new KeyboardItemData(49, '1'),

new KeyboardItemData(50, '2'),

new KeyboardItemData(51, '3'),

new KeyboardItemData(52, '4'),

new KeyboardItemData(53, '5'),

new KeyboardItemData(54, '6'),

new KeyboardItemData(55, '7'),

new KeyboardItemData(56, '8'),

new KeyboardItemData(57, '9'),

new KeyboardItemData(48, '0'),

].sort((a, b) => {

return 0.5 - Math.random();

}),

鸿蒙
7天前
浏览
收藏 0
回答 0
待解决
相关问题
根据list中某项id如何sort排序
323浏览 • 1回复 待解决