在vue项目中使用computed计算属性并传入参数
文章目录
<template>
<div v-if=isType('0')></div>
</template>
computed:{
isType() {
// 需要return一个fn并接收参数
return function(type) {
let is = true
if(type==='1'){
return false
}
return is
}
},
}
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论