指南显示了一个用反引号编写的计算属性。我不确定它们是否有必要。
可以这样:
fullName: Ember.computed('firstName', 'lastName', function() {
return `${this.get('firstName')} ${this.get('lastName')}`;
})
改写成这样:
fullName: Ember.computed('firstName', 'lastName', function() {
return this.get('firstName') + ' ' + this.get('lastName');
})
?
对我来说,这不那么晦涩难懂。每种方法的优缺点是什么?