Browse Source
Merge pull request #702 from colinin/upt-5.3.5
add slot to Formitem
pull/708/head
yx lin
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
7 additions and
1 deletions
-
apps/vue/src/components/Form/src/TabForm.vue
-
apps/vue/src/components/Form/src/components/FormItem.vue
-
apps/vue/src/components/Form/src/types/form.ts
|
|
|
@ -21,7 +21,9 @@ |
|
|
|
<Row v-bind="getRow"> |
|
|
|
<slot name="formHeader"></slot> |
|
|
|
<template v-for="schema in tabSchema.schemas" :key="schema.field"> |
|
|
|
<slot v-if="schema.tabSlot" :name="schema.tabSlot"></slot> |
|
|
|
<FormItem |
|
|
|
v-else |
|
|
|
:tableAction="tableAction" |
|
|
|
:formActionType="formActionType" |
|
|
|
:schema="schema" |
|
|
|
|
|
|
|
@ -317,7 +317,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
function renderItem() { |
|
|
|
const { itemProps, slot, render, field, suffix, component } = props.schema; |
|
|
|
const { itemProps, slot, render, field, suffix, component, extra } = props.schema; |
|
|
|
const { labelCol, wrapperCol } = unref(itemLabelWidthProp); |
|
|
|
const { colon } = props.formProps; |
|
|
|
|
|
|
|
@ -354,6 +354,7 @@ |
|
|
|
<div style="flex:1;">{getContent()}</div> |
|
|
|
{showSuffix && <span class="suffix">{getSuffix}</span>} |
|
|
|
</div> |
|
|
|
{ getSlot(slots, extra) } |
|
|
|
</Form.Item> |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
@ -145,6 +145,8 @@ export interface FormSchema { |
|
|
|
label: string | VNode; |
|
|
|
// Auxiliary text
|
|
|
|
subLabel?: string; |
|
|
|
// extra
|
|
|
|
extra?: string; |
|
|
|
// Help text on the right side of the text
|
|
|
|
helpMessage?: |
|
|
|
| string |
|
|
|
@ -219,6 +221,7 @@ export interface FormSchema { |
|
|
|
|
|
|
|
export interface TabFormSchema extends FormSchema { |
|
|
|
tab: string; |
|
|
|
tabSlot?: string; |
|
|
|
} |
|
|
|
|
|
|
|
export interface HelpComponentProps { |
|
|
|
|