perf: Add the style injection of the top row to the form. (#102)
Co-authored-by: NorthLan <lan6995@gmail.com>
| | |
| | | <template> |
| | | <Form v-bind="{ ...$attrs, ...$props }" ref="formElRef" :model="formModel"> |
| | | <Row :class="getProps.compact ? 'compact-form-row' : ''"> |
| | | <Row :class="getProps.compact ? 'compact-form-row' : ''" :style="getRowWrapStyleRef"> |
| | | <slot name="formHeader" /> |
| | | <template v-for="schema in getSchema" :key="schema.field"> |
| | | <FormItem |
| | |
| | | const propsRef = ref<Partial<FormProps>>({}); |
| | | const schemaRef = ref<Nullable<FormSchema[]>>(null); |
| | | const formElRef = ref<Nullable<FormActionType>>(null); |
| | | |
| | | const getRowWrapStyleRef = computed((): any => { |
| | | const { baseRowStyle } = unref(getProps); |
| | | return baseRowStyle || {}; |
| | | }); |
| | | |
| | | const getMergePropsRef = computed( |
| | | (): FormProps => { |
| | |
| | | getActionPropsRef, |
| | | defaultValueRef, |
| | | advanceState, |
| | | getRowWrapStyleRef, |
| | | getProps, |
| | | formElRef, |
| | | getSchema, |
| | |
| | | type: Object as PropType<any>, |
| | | default: null, |
| | | }, |
| | | baseRowStyle: { |
| | | type: Object as PropType<any>, |
| | | }, |
| | | baseColProps: { |
| | | type: Object as PropType<any>, |
| | | }, |
| | |
| | | // Col configuration for the entire form |
| | | wrapperCol?: Partial<ColEx>; |
| | | |
| | | // General row style |
| | | baseRowStyle?: object; |
| | | |
| | | // General col configuration |
| | | baseColProps?: Partial<ColEx>; |
| | | |