booleen
booleen
  • 发布:2025-02-28 17:57
  • 更新:2025-02-28 18:04
  • 阅读:22

defineExpose接受的参数类型是什么,MAP还是UTSJSONOBJECT

分类:uni-app x

编辑器鼠标放上去提示

function defineExpose<Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed | undefined): void

疑问:
1.但是uts木有Record类型吧,如果没有就不要这样提示了
我传递了个类型:

const formExpose={ validate, clearValidate } as FormExpose
defineExpose(formExpose)

编译到Android模拟器的过程中报错:

[plugin:uni:app-uts] 编译失败
17:35:21.471 ‌error: 类型不匹配: 推断类型是FormExpose,但预期的是Data / = Map<String, Any?> /。‌

所以,defineExpose接受的参数类型是什么

2025-02-28 17:57 负责人:无 分享
已邀请:
DCloud_UNI_FengXY

DCloud_UNI_FengXY

defineExpose目前仅支持{}字面量

要回复问题请先登录注册