Commit c8ef82b2c11c9938f0f7a7f6a1a10010b82979dc
1 parent
cd35d3e0
fix(form): fix baseColProps not work
Showing
4 changed files
with
15 additions
and
4 deletions
CHANGELOG.zh_CN.md
src/components/Form/src/FormItem.tsx
... | ... | @@ -91,7 +91,11 @@ export default defineComponent({ |
91 | 91 | function getShow() { |
92 | 92 | const { show, ifShow } = props.schema; |
93 | 93 | const { showAdvancedButton } = props.formProps; |
94 | - const itemIsAdvanced = showAdvancedButton ? !!props.schema.isAdvanced : true; | |
94 | + const itemIsAdvanced = showAdvancedButton | |
95 | + ? isBoolean(props.schema.isAdvanced) | |
96 | + ? props.schema.isAdvanced | |
97 | + : true | |
98 | + : true; | |
95 | 99 | let isShow = true; |
96 | 100 | let isIfShow = true; |
97 | 101 | ... | ... |
src/components/Form/src/hooks/useAdvanced.ts
... | ... | @@ -132,6 +132,8 @@ export default function ({ |
132 | 132 | function updateAdvanced() { |
133 | 133 | let itemColSum = 0; |
134 | 134 | let realItemColSum = 0; |
135 | + const { baseColProps = {} } = unref(getProps); | |
136 | + | |
135 | 137 | for (const schema of unref(getSchema)) { |
136 | 138 | const { show, colProps } = schema; |
137 | 139 | let isShow = true; |
... | ... | @@ -152,8 +154,11 @@ export default function ({ |
152 | 154 | }); |
153 | 155 | } |
154 | 156 | |
155 | - if (isShow && colProps) { | |
156 | - const { itemColSum: sum, isAdvanced } = getAdvanced(colProps, itemColSum); | |
157 | + if (isShow && (colProps || baseColProps)) { | |
158 | + const { itemColSum: sum, isAdvanced } = getAdvanced( | |
159 | + { ...baseColProps, ...colProps }, | |
160 | + itemColSum | |
161 | + ); | |
157 | 162 | |
158 | 163 | itemColSum = sum || 0; |
159 | 164 | if (isAdvanced) { | ... | ... |
src/components/Table/src/BasicTable.vue