Heim  >  Fragen und Antworten  >  Hauptteil

angular.js - ng-options 瞎排序的问题

Object {0: 0, 1: 2, 2: 4, 3: 6, 4: 8, 5: 11, 6: 13, 7: 15, 8: 17, 9: 19, 10: 22, 11: 24, 12: 26, 13: 28, 14: 30, 15: 33, 16: 35, 17: 37, 18: 39, 19: 41, 20: 44, 21: 46, 22: 48, 23: 50, 24: 52, 25: 55, 26: 57}

结果
遍历的option 的 value 却是

1
10
100
101
...
11
110

我没设置排序哇。。

黄舟黄舟2688 Tage vor758

Antworte allen(2)Ich werde antworten

  • 给我你的怀抱

    给我你的怀抱2017-05-15 16:51:44

    把你的那个对象转成数组吧,http://jsfiddle.net/gzozycj8/2/

    Antwort
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-15 16:51:44

    Object没有顺序。数组才有顺序。

    Antwort
    0
  • StornierenAntwort