In an Ember.js Handlebars template, is there a way to have both static and dynamic class attributes?

后端 未结 4 1961
青春惊慌失措
青春惊慌失措 2021-02-13 19:34

Using the already-overused to-do app example, let\'s say I want an element with a \"todo\" class (static) and an \"is-done\" class (dynamic):



        
4条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-13 20:20

    I don't know if you can do it with bindAttr, but the #view helper does allow you to set both static classes and dynamic ones:

    {{#view App.TodoView class="todo" classBinding="isDone"}}
      inner content
    {{/view}} 
    

提交回复
热议问题