-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow absolute URL navigation (#748)
- Loading branch information
1 parent
1fb6c07
commit 38c486f
Showing
5 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import mesop as me | ||
|
||
|
||
@me.page(path="/navigate_absolute") | ||
def page1(): | ||
me.text("Navigate to absolute URLs") | ||
me.button("navigate https", on_click=navigate_https) | ||
me.button("navigate http", on_click=navigate_http) | ||
me.button("navigate yield", on_click=navigate_yield) | ||
|
||
|
||
def navigate_https(e: me.ClickEvent): | ||
me.navigate("https://google.com/") | ||
|
||
|
||
def navigate_http(e: me.ClickEvent): | ||
me.navigate("http://example.com/") | ||
|
||
|
||
def navigate_yield(e: me.ClickEvent): | ||
yield | ||
me.navigate("https://google.com/") | ||
yield |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters