计算属性不能直接传参,通过返回一个函数实现根据具体参数来计算返回数据
export default {
data () {
return {}
},
computed: {
test() {
return function(index){
return this.data[index].num
}
}
}
}