Skip to content

Commit

Permalink
feat(Form): 表单增加是否显示属性
Browse files Browse the repository at this point in the history
  • Loading branch information
D-xuanmo committed Jul 15, 2023
1 parent c1099c7 commit ca6a2ef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/dl-common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xuanmo/dl-common",
"version": "0.0.2-beta.20",
"version": "0.0.2-beta.21",
"author": {
"name": "xuanmo",
"email": "me@xuanmo.xin"
Expand Down
6 changes: 5 additions & 1 deletion packages/dl-common/src/form/render.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<template>
<div :class="wrapperClassName">
<template v-for="item in data">
<div v-if="item.layout.parent === 'root'" :key="item.id" :class="itemClassName">
<div
v-if="item.layout.parent === 'root' && item.display !== false"
:key="item.id"
:class="itemClassName"
>
<d-form-item v-if="item.dataKey" :model="item" />
<component :is="item.component" v-else :model="item" />
</div>
Expand Down
3 changes: 3 additions & 0 deletions packages/dl-common/src/form/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export interface IRenderModel<T = any> {
// 关联的子级
children?: string[]
}

// 是否显示
display?: boolean
}

export interface IFormModelItem<TValue = unknown, TProps = Record<string, any>>
Expand Down

0 comments on commit ca6a2ef

Please sign in to comment.