소스 검색

fix bug

[Vue warn]: Invalid prop: custom validator check failed for prop "variant".
Bk201 2 달 전
부모
커밋
0a819df2bf
1개의 변경된 파일11개의 추가작업 그리고 1개의 파일을 삭제
  1. 11 1
      apps/web-tdesign/src/adapter/component/index.ts

+ 11 - 1
apps/web-tdesign/src/adapter/component/index.ts

@@ -165,7 +165,17 @@ async function initComponentAdapter() {
     DatePicker,
     // 自定义默认按钮
     DefaultButton: (props, { attrs, slots }) => {
-      return h(Button, { ...props, attrs, theme: 'default' }, slots);
+      let ghost = false;
+      let variant = props.variant;
+      if (props.variant === 'ghost') {
+        ghost = true;
+        variant = 'base';
+      }
+      return h(
+        Button,
+        { ...props, ghost, variant, attrs, theme: 'default' },
+        slots,
+      );
     },
     Divider,
     IconPicker: withDefaultPlaceholder(IconPicker, 'select', {