update: placeholder update

This commit is contained in:
dap 2025-04-16 13:53:58 +08:00
parent f096dfc6e6
commit e587256425

View File

@ -9,7 +9,6 @@ import type { BaseFormComponentType } from '@vben/common-ui';
import type { Recordable } from '@vben/types';
import {
computed,
defineAsyncComponent,
defineComponent,
getCurrentInstance,
@ -91,15 +90,10 @@ const withDefaultPlaceholder = <T extends Component>(
inheritAttrs: false,
name: component.name,
setup: (props: any, { attrs, expose, slots }) => {
/**
* 使computed updateSchema更新的placeholder无法显示()
*/
const placeholder = computed(
() =>
props?.placeholder ||
attrs?.placeholder ||
$t(`ui.placeholder.${type}`),
);
const placeholder =
props?.placeholder ||
attrs?.placeholder ||
$t(`ui.placeholder.${type}`);
// 透传组件暴露的方法
const innerRef = ref();
@ -118,7 +112,7 @@ const withDefaultPlaceholder = <T extends Component>(
component,
{
...componentProps,
placeholder: placeholder.value,
placeholder,
...props,
...attrs,
ref: innerRef,