Sfoglia il codice sorgente

fix:提取AttrType类型

MTrun 3 anni fa
parent
commit
f91b1d7f8a
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      src/views/chart/ContentEdit/hooks/useStyle.hook.ts

+ 3 - 1
src/views/chart/ContentEdit/hooks/useStyle.hook.ts

@@ -1,5 +1,7 @@
 import { PublicConfigType } from '@/packages/index.d'
-type AttrType = Pick<PublicConfigType, 'attr'>['attr']
+
+type PickPublicConfigType<T extends keyof PublicConfigType> = Pick<PublicConfigType, T>[T]
+type AttrType = PickPublicConfigType<'attr'>
 
 export const useComponentStyle = (attr: AttrType, index: number) => {
   const componentStyle = {