mirror of
https://github.com/pyscript/pyscript.git
synced 2026-04-30 16:00:32 -04:00
[next] Drop web like events (#1578)
* Use registerJSModule when available (#1573) * Updated version to publish latest
This commit is contained in:
committed by
GitHub
parent
a14e701be4
commit
c6b5ce7f55
@@ -29,14 +29,14 @@
|
||||
|
||||
const button = document.createElement("button");
|
||||
button.textContent = "click";
|
||||
button.setAttribute("mpy-click", "test_click(event)");
|
||||
button.setAttribute("mpy-click", "test_click");
|
||||
document.body.append(button);
|
||||
},
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<mpy-script mpy-click="test_click(event)">
|
||||
<mpy-script mpy-click="test_click">
|
||||
def test_click(event):
|
||||
print(event.type)
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
print(sys.version)
|
||||
</script>
|
||||
<button
|
||||
pyodide-pointerdown="print_version(event)"
|
||||
pyodide-click="print_version(event)"
|
||||
pyodide-pointerdown="print_version"
|
||||
pyodide-click="print_version"
|
||||
>
|
||||
pyodide version
|
||||
</button>
|
||||
@@ -29,8 +29,8 @@
|
||||
print(sys.version)
|
||||
</script>
|
||||
<button
|
||||
micropython-pointerdown="print_version(event)"
|
||||
micropython-click="print_version(event)"
|
||||
micropython-pointerdown="print_version"
|
||||
micropython-click="print_version"
|
||||
>
|
||||
micropython version
|
||||
</button>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script type="module" src="../esm/index.js"></script>
|
||||
<script type="module" src="../core.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script type="ruby-wasm-wasi">
|
||||
@@ -24,7 +24,7 @@
|
||||
print "ruby #{ RUBY_VERSION }p#{ RUBY_PATCHLEVEL }"
|
||||
end
|
||||
</script>
|
||||
<button ruby-wasm-wasi-click="print_version($event)">
|
||||
<button ruby-wasm-wasi-click="print_version">
|
||||
ruby-wasm-wasi version
|
||||
</button>
|
||||
</body>
|
||||
|
||||
@@ -33,6 +33,6 @@
|
||||
print(read_file('/a.py'))
|
||||
end
|
||||
</script>
|
||||
<button wasmoon-click="print_version(event)">wasmoon version</button>
|
||||
<button wasmoon-click="print_version">wasmoon version</button>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<input type="text" placeholder="loading ..." required disabled />
|
||||
<input
|
||||
type="submit"
|
||||
micropython-click="handle_result(event)"
|
||||
micropython-click="handle_result"
|
||||
disabled
|
||||
/>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user