Skip to content

Commit

Permalink
feat: 解决Form组件slot必须传递component字段才显示的问题 (#3049)
Browse files Browse the repository at this point in the history
feat: 解决Form组件slot必须传递component字段才显示的问题
  • Loading branch information
zmcode committed Sep 21, 2023
1 parent 556575f commit a6b65b5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/Form/src/components/FormItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@
const joinLabel = Reflect.has(props.schema, 'rulesMessageJoinLabel')
? rulesMessageJoinLabel
: globalRulesMessageJoinLabel;
const defaultMsg = createPlaceholderMessage(component) + `${joinLabel ? label : ''}`;
const assertLabel = joinLabel ? label : '';
const defaultMsg = component
? createPlaceholderMessage(component) + assertLabel
: assertLabel;
function validator(rule: any, value: any) {
const msg = rule.message || defaultMsg;
Expand Down Expand Up @@ -382,8 +385,8 @@
}
return () => {
const { colProps = {}, colSlot, renderColContent, component } = props.schema;
if (!componentMap.has(component)) {
const { colProps = {}, colSlot, renderColContent, component, slot } = props.schema;
if (!componentMap.has(component) && !slot) {
return null;
}
Expand Down

0 comments on commit a6b65b5

Please sign in to comment.