环回4:如何编辑“ @property”装饰器在“实体”道具上设置的元数据?

问题描述

我将第三方实体类自定义道具一起使用。我对其进行了扩展,并且需要在我扩展的类中定义的现有道具中添加其他元。

这是一个代码示例。它行不通,只是为了更好地解释我想完成的事情而写:

export abstract class MyEntity extends ThirdPartyEntity {
  @property({
    // This is additional Meta I want to add.
    myMetaProp: 'some value'
  })
  // This prop is already defined and decorated with `@property` in the `ThirdPartyEntity`.
  thirdPartyProp: string;
}

如上所述,这不起作用。它将产生此错误-@property cannot be applied more than once on。 您不能一起添加/删除或覆盖@property装饰器定义的元。

我决心使用此解决方法MyEntity.deFinition.properties.thirdPartyProp.myMetaProp = 'some value'

问题是:是否有更好和声明性的方式来编辑props Meta?我已经尝试过MetadataInspector.defineMetadata,但没有完成任何事情。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)