booleen
booleen
  • 发布:2025-02-25 21:44
  • 更新:2025-02-25 21:44
  • 阅读:17

UTS这报错是啥意思啊我都as any了非得给我继续报错

分类:uni-app x

代码:

const x=rules[props.prop] as any as Rule[]  
const formRules = (x || []) as Rule[]

非得说rules[props.prop]预测为boolean!!!!

是不是我不知道吗

我都给你转any了,你还想怎么样!!!!

rules[props.prop]?怎么可能会是boolean,!!

type Rule = {
required ?: boolean
message ?: string
min ?: number
max ?: number
range ?: number[]
pattern ?: RegExp
validator ?: (value : any, rule : Rule, cb : (t : any) => void) => boolean
}

2025-02-25 21:44 负责人:无 分享
已邀请:

要回复问题请先登录注册