Assigning 'active' class to selected list item in EmberJS

后端 未结 12 2083
星月不相逢
星月不相逢 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:21

    If I may suggest another solution that requires nothing but Handlebars:

  • {{#link-to "path" viewName="innerLink"}}Click{{/link-to}}
  • This sets the LinkView object as a member of the parent view, which's active attribute you can then reference.

提交回复
热议问题