vue中computed计算属性传入参数

2021-03-01  本文已影响0人  Cherry丶小丸子
<template slot-scope="scope">
    <div :name="getFirstName(scope.row.firstName)"></div>
    <div :name="getAllName(scope.row.firstName, scope.row.lastName)"></div>
</template>

computed:{
    getFirstName(){
        return firstName => {
            console.log(firstName)
            return firstName
        }
    },
    getAllName(){
        return (firstName, lastName)=> {
            console.log(firstName, lastName)
            return `${firstName}${lastName}`
        }
    }
}
上一篇下一篇

猜你喜欢

热点阅读