lowcode-engine icon indicating copy to clipboard operation
lowcode-engine copied to clipboard

扩展一下物料协议, 添加组件默认属性列表, 出码过滤下, 会不会代码美观一些?

Open huangapple opened this issue 3 years ago • 0 comments

大多数的物料的大部分属性平时用得比较少, 都用默认值。目前出码会把这些默认值也显式赋值进去, 造成二次开发不美观。

扩展一下物料协议, 添加组件默认属性列表, 出码过滤下, 会不会代码美观一些?

比如Button

<Button
  type="primary"
  __component_name="Button"
  htmlType="button"
  size="middle"
  shape="default"
  icon=""
  block={false}
  danger={false}
  ghost={false}
  disabled={false}
>xxx</Button>

如果过滤掉默认的属性, 代码看起来就会很清爽

<Button  type="primary"  __component_name="Button">xxx</Button>

huangapple avatar Dec 02 '22 01:12 huangapple