[next] Cumulative pre-release patches (#1682)

This commit is contained in:
Andrea Giammarchi
2023-09-07 15:17:09 +02:00
committed by GitHub
parent d56eeb59ed
commit 0696e4682d
6 changed files with 86 additions and 32 deletions

View File

@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PyScript Next Plugin Bug?</title>
<link rel="stylesheet" href="../dist/core.css">
<script type="module" src="../dist/core.js"></script>
</head>
<body>
<script type="py">
from pyscript import display, document
from datetime import datetime as dt
from pyodide.ffi.wrappers import add_event_listener
element = document.querySelector("#just-a-button")
def on_click(event):
print(f"Hello from Python! {dt.now()}")
display(f"Hello from Python! {dt.now()}", append=False, target='eresult')
add_event_listener(element, "click", on_click)
</script>
<button id="just-a-button">click and check the console</button>
<div id="result"></div>
</body>
</html>