Spaces:
Running
Running
File size: 552 Bytes
8e04495 d8d6fe1 8e04495 45df88a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
import mesop as me
@me.stateclass
class State:
input: str = ""
def on_blur(e: me.InputBlurEvent):
state = me.state(State)
state.input = e.value
def load(e: me.LoadEvent):
me.set_theme_mode("system")
@me.page(
on_load=load,
security_policy=me.SecurityPolicy(
allowed_iframe_parents=["https://mesop-dev.github.io"]
),
path="/input",
)
def app():
with me.box(style=me.Style(margin=me.Margin.all(15))):
s = me.state(State)
me.input(label="Basic input", appearance="outline", on_blur=on_blur)
me.text(text=s.input)
|