mirror of
https://github.com/imdap/ruoyi-plus-vben5.git
synced 2026-05-12 14:12:08 +08:00
fix: 修复 FormField 在 SFC 中的运行时异常
This commit is contained in:
@@ -1,7 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ZodType } from 'zod';
|
import type { ZodType } from 'zod';
|
||||||
|
|
||||||
import type { FormActions, FormSchema, MaybeComponentProps } from '../types';
|
import type {
|
||||||
|
FormActions,
|
||||||
|
FormFieldProps,
|
||||||
|
MaybeComponentProps,
|
||||||
|
} from '../types';
|
||||||
|
|
||||||
import { computed, nextTick, onUnmounted, useTemplateRef, watch } from 'vue';
|
import { computed, nextTick, onUnmounted, useTemplateRef, watch } from 'vue';
|
||||||
|
|
||||||
@@ -26,7 +30,7 @@ import useDependencies from './dependencies';
|
|||||||
import FormLabel from './form-label.vue';
|
import FormLabel from './form-label.vue';
|
||||||
import { isEventObjectLike } from './helper';
|
import { isEventObjectLike } from './helper';
|
||||||
|
|
||||||
interface Props extends FormSchema {}
|
interface Props extends FormFieldProps {}
|
||||||
|
|
||||||
const {
|
const {
|
||||||
colon,
|
colon,
|
||||||
|
|||||||
@@ -300,8 +300,13 @@ export type ArrayToStringFields = Array<
|
|||||||
| string[] // 简单数组格式,最后一个元素可以是分隔符
|
| string[] // 简单数组格式,最后一个元素可以是分隔符
|
||||||
>;
|
>;
|
||||||
|
|
||||||
export interface FormFieldProps extends FormSchema {
|
export interface FormFieldProps<
|
||||||
required?: boolean;
|
T extends BaseFormComponentType = BaseFormComponentType,
|
||||||
|
> extends FormSchemaBody {
|
||||||
|
/** 组件 */
|
||||||
|
component: Component | T;
|
||||||
|
/** 组件参数 */
|
||||||
|
componentProps?: ComponentProps;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FormRenderProps<
|
export interface FormRenderProps<
|
||||||
|
|||||||
Reference in New Issue
Block a user