HarmonyOS @Component和@Builder中是否支持动态组件?

在组件UI Syntax中使用动态组件进行渲染。请问现在是否支持?或者是有没有其他类似的替代做法?

伪代码示例:

@Component
struct ComA {
  build() {
    Text("Hi~ 我是组件A")
  }
}
@Component
struct ComB {
  build() {
    Text("Hi~ 我是组件B")
  }
}
// 定义一个可用组件kv
const components: Record<string, object> = {
  "a": ComA,
  "b": ComB,
};

@Entry
@Component
struct Index {
  build() {
    CustomComponent({ name: "a" })
  }
}

struct CustomComponent {
  @Prop name: string;

  build() {
    components[this.name] ?? Text("无可用组件")
  }
}
阅读 715