|
@@ -48,6 +48,7 @@ const {
|
|
|
modelPropName,
|
|
modelPropName,
|
|
|
renderComponentContent,
|
|
renderComponentContent,
|
|
|
rules,
|
|
rules,
|
|
|
|
|
+ help,
|
|
|
} = defineProps<
|
|
} = defineProps<
|
|
|
Props & {
|
|
Props & {
|
|
|
commonComponentProps: MaybeComponentProps;
|
|
commonComponentProps: MaybeComponentProps;
|
|
@@ -174,6 +175,18 @@ const computedProps = computed(() => {
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+// 自定义帮助信息
|
|
|
|
|
+const computedHelp = computed(() => {
|
|
|
|
|
+ return help ? onHelpFunc : undefined;
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+const onHelpFunc = () => {
|
|
|
|
|
+ if (!help) {
|
|
|
|
|
+ return undefined;
|
|
|
|
|
+ }
|
|
|
|
|
+ return isFunction(help) ? help(values.value, formApi!) : help;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
watch(
|
|
watch(
|
|
|
() => computedProps.value?.autofocus,
|
|
() => computedProps.value?.autofocus,
|
|
|
(value) => {
|
|
(value) => {
|
|
@@ -322,7 +335,7 @@ onUnmounted(() => {
|
|
|
labelClass,
|
|
labelClass,
|
|
|
)
|
|
)
|
|
|
"
|
|
"
|
|
|
- :help="help"
|
|
|
|
|
|
|
+ :help="computedHelp"
|
|
|
:colon="colon"
|
|
:colon="colon"
|
|
|
:label="label"
|
|
:label="label"
|
|
|
:required="shouldRequired && !hideRequiredMark"
|
|
:required="shouldRequired && !hideRequiredMark"
|