📜  mobx 中计算的内容 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:44.340000             🧑  作者: Mango

代码示例1
import {observable, computed} from 'mobx'

class Page {
  @observable title = ''
  @observable published = false
  @observable author = null

  @computed get authorName () {
    return this.author || 'Anonymous'
  }
}