What is the best way to do something when a page is loaded? #137
Answered
by
Alek99
matt-grain
asked this question in
Q&A
-
|
Hi, In case some stuff has to be initialized when a page is loaded, what is the best way to trigger this part of the code? pc.link(
pc.image(src="/logo.jpg", width="auto", height="3em"),
href="/page2",
style=index_image,
on_click=lambda: AppState.set_name("my name"),
), |
Beta Was this translation helpful? Give feedback.
Answered by
Alek99
Dec 18, 2022
Replies: 2 comments 12 replies
-
|
I think the best would be to use a computed var |
Beta Was this translation helpful? Give feedback.
12 replies
Answer selected by
matt-grain
-
|
Big thanks to @Lendemor, made a pr today to add this see here: 52aaf36. This will be included in the next release. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think the best would be to use a computed var