INNER CODE UNIT · TypeScript

PreviewGroup

LoD-Dawn/Fast-Vben-Admin · frontend/apps/web-antd/src/adapter/component/index.ts:130

const PreviewGroup = defineAsyncComponent(() =>
  import('ant-design-vue/es/image').then((res) => res.ImagePreviewGroup),
);

const withDefaultPlaceholder = (
  component: Component,
  type: 'input' | 'select',
  componentProps: Recordable<any> = {},
) => {
  return defineComponent({
    name: component.name,
    inheritAttrs: false,
    setup: (props: any, { attrs, expose, slots }) => {
      const placeholder =
        props?.placeholder ||
        attrs?.placeholder ||
        $t(`ui.placeholder.${type}`);
      // 透传组件暴露的方法

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…