Ver código fonte

fix(table): fix `injection not found` warning

修复injection警告
无木 3 anos atrás
pai
commit
53e79a2d94
1 arquivos alterados com 4 adições e 2 exclusões
  1. 4 2
      src/components/Table/src/BasicTable.vue

+ 4 - 2
src/components/Table/src/BasicTable.vue

@@ -106,11 +106,13 @@
         return { ...props, ...unref(innerPropsRef) } as BasicTableProps;
       });
 
-      const isFixedHeightPage = inject(PageWrapperFixedHeightKey);
+      const isFixedHeightPage = inject(PageWrapperFixedHeightKey, false);
       watchEffect(() => {
         unref(isFixedHeightPage) &&
           props.canResize &&
-          warn("[BasicTable] 'canResize' may not worked in PageWrapper with 'fixedHeight'");
+          warn(
+            "'canResize' of BasicTable may not work in PageWrapper with 'fixedHeight' (especially in hot updates)"
+          );
       });
 
       const { getLoading, setLoading } = useLoading(getProps);