Yummy-Yums hai 1 ano
pai
achega
0a78c8ab83
Modificáronse 1 ficheiros con 11 adicións e 0 borrados
  1. 11 0
      reflex/components/el/elements/media.py

+ 11 - 0
reflex/components/el/elements/media.py

@@ -1,6 +1,7 @@
 """Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
 """Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
 from typing import Any, Union
 from typing import Any, Union
 
 
+from reflex import Component
 from reflex.vars import Var as Var
 from reflex.vars import Var as Var
 
 
 from .base import BaseHTML
 from .base import BaseHTML
@@ -78,6 +79,16 @@ class Audio(BaseHTML):
 class Img(BaseHTML):
 class Img(BaseHTML):
     """Display the img element."""
     """Display the img element."""
 
 
+    @classmethod
+    def create(cls, *children, **props) -> Component:
+        if len(children) == 0:
+            comp = super().create(*children, **props)
+            print(props)
+        else:
+            return super().create(src=children[0], **props)
+
+        return comp
+
     tag = "img"
     tag = "img"
 
 
     # Image alignment with respect to its surrounding elements
     # Image alignment with respect to its surrounding elements