HarmonyOS promptAction.openCustomDialog customDialog使用组件外的builder会报错?

customDialog使用组件外的builder会报错

promptAction.openCustomDialog({
  builder: () => {
    customDialogComponent
  },
  isModal: false,
  width: 126,
  height: 66,
  background color: '#00fffff',
  backgroundBlurStyle: BlurStyle.NONE,
  cornerRadius: 0,
})

Module name:com.example.myapplication

Version:1.0.0

Version Code: 10000

PreInstalled:No

Foreground:No

Pid:19499

Uid:20020015

Reason:TypeError

Error name:TypeError

Error message:Cannot read property observeComponentCreation2 of undefined

SourceCode:

(parent ? parent : this).observeComponentCreation2((elmtId, isInitialRender) =\> {

Stacktrace:

at customDialogComponent (entry/src/main/ets/pages/Index.ets:97:31)

at builder (entry/src/main/ets/pages/Index.ets:133:17)

阅读 484
1 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进