HarmonyOS Next ArkTS报错Object literals cannot be used as type declarations 怎么解决?

99 阅读1分钟

出现的问题:
@Builder
MoreBuilder(params:{ title: string }) {
  Row() { 
  }
}

解决问题:

定义:interface Params { title: string }

然后再使用:MoreBuilder(params: Params = { title: '' })

最后问题完美解决