Yummy-Yums 1 vuosi sitten
vanhempi
säilyke
0a78c8ab83
1 muutettua tiedostoa jossa 11 lisäystä ja 0 poistoa
  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."""
 from typing import Any, Union
 
+from reflex import Component
 from reflex.vars import Var as Var
 
 from .base import BaseHTML
@@ -78,6 +79,16 @@ class Audio(BaseHTML):
 class Img(BaseHTML):
     """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"
 
     # Image alignment with respect to its surrounding elements