'PageManager.shared' does not comply with the UI component syntax. <ArkTSCheck>
复制代码
封装
因为ArkUI的页面是基于struct而不是class,所以无法继承,也无法声明一个符合comply with the UI component syntax要求的范例。
看似陷入了死胡同,不外官方也考虑到了,所以提供了一个特殊范例:WrappedBuilder。
可以利用wrapBuilder函数创建该范例,但需要传入一个@builder装饰的函数作为参数。