Skip to content

Commit 3b894fd

Browse files
committed
feat(prop): add visible config
1 parent abe1aa8 commit 3b894fd

File tree

1 file changed

+7
-1
lines changed
  • front-end/h5/src/components/core/editor/edit-panel

1 file changed

+7
-1
lines changed

front-end/h5/src/components/core/editor/edit-panel/props.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,13 @@ export default {
138138
{
139139
Object
140140
.entries(props)
141-
.filter(([propKey, propConfig]) => propConfig.visible && propConfig.editor && !propConfig.editor.custom)
141+
.filter(([propKey, propConfig]) => {
142+
// 1. 如果开发者给 某个prop 显式指定了 visible 属性,则取开发者指定的值;
143+
// 2. 否则取默认值:true,即默认在属性面板显示该属性
144+
// 3. 组件的某些属性是不需要显示在 配置编辑器的,比如:editorMode(编辑模式/预览模式),因为这个是鲁班编辑器默认注入到每个组件的,无须显示出来
145+
const isVisible = propConfig.hasOwnProperty('visible') ? propConfig.visible : true
146+
return isVisible && propConfig.editor && !propConfig.editor.custom
147+
})
142148
.map(([propKey, propConfig]) => this.renderPropFormItem(h, { propKey, propConfig }))
143149
}
144150
</a-form>

0 commit comments

Comments
 (0)