Browse Source
feat: 解决Form组件slot必须传递component字段才显示的问题 (#3049)
feat: 解决Form组件slot必须传递component字段才显示的问题
pull/3060/head
zmcode
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
3 deletions
-
src/components/Form/src/components/FormItem.vue
|
|
|
@ -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; |
|
|
|
@ -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; |
|
|
|
} |
|
|
|
|
|
|
|
|