Ember computed properties in Coffeescript

前端 未结 3 1178
醉酒成梦
醉酒成梦 2020-12-03 20:54

I want to implement the following Javascript code in Coffeescript

App.ItemView = Ember.View.extend({
    classNameBindings: [\'itemId\'],
    itemId: functio         


        
3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-03 21:31

    I like to use Ember.computed.

    itemId: Ember.computed 'firstName', 'lastName', ->
      "#{@get('firstName')} #{@get('lastName')}"
    

提交回复
热议问题