Conversation
docs/docs/api/configOptions.md
Outdated
| focusNodeSelector?: (rootNode: IPublicModelNode) => Node; | ||
| ``` | ||
|
|
||
| #### supportResetFieldsGlobally - 设置所有属性支持重置 |
There was a problem hiding this comment.
supportResetFieldsGlobally 改成 supportResetGlobally
docs/docs/api/configOptions.md
Outdated
|
|
||
| #### supportResetFieldsGlobally - 设置所有属性支持重置 | ||
| `@type {boolean}` `@default {false}` | ||
| 设置所有属性支持重置, 开启后组件属性setter后会有一个重置按钮,将属性重置为初始状态。 |
There was a problem hiding this comment.
这里重置的概念可以再描述的清晰一点,我会奇怪,它充值成默认值,还是什么值?比如,没有打开设置器面板的时候,可能是一个值,打开设置器面板之后又是另外的值。
docs/docs/specs/material-spec.md
Outdated
| | name | 属性名 | String | type = 'field' 生效 | | ||
| | defaultValue | 默认值 | Any(视字段类型而定) | type = 'field' 生效 | | ||
| | supportVariable | 是否支持配置变量 | Boolean | type = 'field' 生效 | | ||
| | supportResetFields | 是否支持配置重置属性 | Boolean | type = 'field' 生效 | |
There was a problem hiding this comment.
supportResetFields => supportReset
| } | ||
| resetIconClickHandler() { | ||
| const { children } = this.props; | ||
| if (children && (children as any).props) { |
There was a problem hiding this comment.
这里去掉 as any,换成合适的 TS 表达式
There was a problem hiding this comment.
改父组件让initialValue和children一样传下来,而不是从children中拿这样?
There was a problem hiding this comment.
这个能力应该参考 supportVariableGlobally 的逻辑,首先新增一个 ResetSetter、再在 settings-pane 里面支持。
There was a problem hiding this comment.
新增一个ResetSetter确实比较好,没增加到ext中是考虑到之前ext项目pr处理的比较慢更新的不频繁
| <div key="body" ref={(shell) => { this.body = shell; }} className="lc-field-body"> | ||
| {children} | ||
| </div> | ||
| {display !== 'block' && resetValue && <Title className="lc-reseticon" title={{ tip: '重置属性', icon: <ResetIcon fill="#8f9bb3" /> }} onClick={() => this.resetIconClickHandler()} />} |
There was a problem hiding this comment.
这里的 tip: '重置属性' 需要支持国际化,参考同文件的 intl('Attribute: ')。
这里的样式需要使用 css 变量。参考:https://lowcode-engine.cn/site/docs/guide/expand/editor/theme
There was a problem hiding this comment.
这里还有个问题,display !== 'block' && resetValue 这两个条件没有写到描述里面
其中 resetValue 不存在的情况下,reset 的行为,是不是应该将值删除。
There was a problem hiding this comment.
css只加了一个cursor: pointer就不用使用变量了吧 😊
|
ext仓库的pr alibaba/lowcode-engine-ext#77 |
| } | ||
| } | ||
| } | ||
| .lc-reseticon { |
|
改完了,看看还有别的问题吗,忘记在这里评论更新信息了 😂 |


类似于
supportVariableGlobally,支持在init时设置supportResetFieldsGlobally,开启全局配置。组件属性setter后会有一个重置按钮,将属性重置为初始状态。在物料props中设置
supportResetFields,来开启当前属性是否支持展示重置按钮.例如:antd按钮的尺寸中设置
demo项目init时开启全局
最终在浏览器中展示