coolair
V2EX  ›  问与答

Select2 ajax 获取数据的时候如何使得 option 的 value 为 text 的值而不是 id 的值呢?

  •  
  •   coolair · Apr 18, 2017 · 3038 views
    This topic created in 3487 days ago, the information mentioned may be changed or developed.
    3 replies  •  2018-01-09 11:42:26 +08:00
    JerryZhang
    JerryZhang
    Apr 18, 2017
    1
    API 返回值中的 id 填为 text 不就行了吗?
    coolair
    coolair
    OP
    Apr 18, 2017
    2
    @JerryZhang API 是别人的改不了呀。
    JerryZhang
    JerryZhang
    Jan 9, 2018
    3
    @coolair 可以改的,你仔细阅读文档。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4900 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 07:22 · PVG 15:22 · LAX 23:22 · JFK 02:22
    ♥ Do have faith in what you're doing.