Assigning 'active' class to selected list item in EmberJS

后端 未结 12 2093
星月不相逢
星月不相逢 2020-12-08 00:34

I have a list and I\'d like to set one item as class=\"active\" automatically. Given the following bootstrap code:

12条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-08 01:05

    Just nest the {{link-to}} with a tagName on the outer one. I'm doing this on EmberJS 2.0.

    {{#link-to "admin.websocket" tagName="li"}}
        {{#link-to "admin.websocket"}}WebSocket{{/link-to}}
    {{/link-to}}
    

提交回复
热议问题