Vue -computed传参数

vue 中computed想传递参数怎么办?
闭包在这里起到的重要的作用

vue 组件间传值

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

computed:{
    newItem:function(){
        return function(key,val){
            return key + " " + val
        }
    }
}
posted @ 2018-11-10 21:03  sfornt  阅读(1456)  评论(0编辑  收藏  举报