Ver código fonte

fix:提取AttrType类型

MTrun 3 anos atrás
pai
commit
f91b1d7f8a
1 arquivos alterados com 3 adições e 1 exclusões
  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 = {