开发者社区 问答 正文

Vue中computer Setter代码是什么呀?

Vue中computer Setter代码是什么呀?

展开
收起
游客r3yctwty2duzw 2022-08-11 21:28:35 309 分享 版权
1 条回答
写回答
取消 提交回答
  • 代码如下

    Computed Setter
    
    computed: {
    
    fullName:
    
    // getter
    
    get: function () f
    
    return this.firstName +
    
    + this.lastName
    
    // setter
    
    set: function (newValue) {
    
    var names = newValue.split(" ')
    
    this. firstName = names[0]
    
    this.lastName = names[names.length - 1]
    
    2022-08-12 08:31:25
    赞同 展开评论
问答分类:
问答标签:
问答地址: