Can I pass parameters in computed properties in Vue.Js

前端 未结 10 1225
借酒劲吻你
借酒劲吻你 2020-11-27 10:38

is this possible to pass parameter in computed properties in Vue.Js. I can see when having getters/setter using computed, they can take a parameter and assign it to a variab

10条回答
  •  南方客
    南方客 (楼主)
    2020-11-27 10:45

    computed: {
      fullName: (app)=> (salut)=> {
          return salut + ' ' + this.firstName + ' ' + this.lastName    
      }
    }
    

    when you want use

    {{fullName('your salut')}}

提交回复
热议问题