Prechádzať zdrojové kódy

Flex props to support Lists (#1553)

Elijah Ahianyo 1 rok pred
rodič
commit
6c517a39df
1 zmenil súbory, kde vykonal 4 pridanie a 2 odobranie
  1. 4 2
      reflex/components/layout/flex.py

+ 4 - 2
reflex/components/layout/flex.py

@@ -1,5 +1,7 @@
 """A reflexive container component."""
 """A reflexive container component."""
 
 
+from typing import List, Union
+
 from reflex.components.libs.chakra import ChakraComponent
 from reflex.components.libs.chakra import ChakraComponent
 from reflex.vars import Var
 from reflex.vars import Var
 
 
@@ -16,7 +18,7 @@ class Flex(ChakraComponent):
     basis: Var[str]
     basis: Var[str]
 
 
     # Shorthand for flexDirection style prop
     # Shorthand for flexDirection style prop
-    direction: Var[str]
+    direction: Var[Union[str, List[str]]]
 
 
     # Shorthand for flexGrow style prop
     # Shorthand for flexGrow style prop
     grow: Var[str]
     grow: Var[str]
@@ -25,7 +27,7 @@ class Flex(ChakraComponent):
     justify: Var[str]
     justify: Var[str]
 
 
     # Shorthand for flexWrap style prop
     # Shorthand for flexWrap style prop
-    wrap: Var[str]
+    wrap: Var[Union[str, List[str]]]
 
 
     # Shorthand for flexShrink style prop
     # Shorthand for flexShrink style prop
     shrink: Var[str]
     shrink: Var[str]