vue 中computed想传递参数怎么办?

闭包在这里起到的重要的作用


<input v-model="newItem(key,val)" type="text"/>

computed:{
    newItem:function(){
        return function(key,val){
            return key + " " + val
        }
    }
}

原文地址:https://segmentfault.com/a/1190000016962393

相关文章:

  • 2021-04-25
  • 2022-12-23
  • 2021-04-02
  • 2022-01-05
  • 2021-11-07
猜你喜欢
  • 2022-12-23
  • 2021-10-27
  • 2023-03-05
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案