mirror of
https://github.com/pyscript/pyscript.git
synced 2026-03-01 08:05:29 -05:00
Added py:all-done event (#1756)
This commit is contained in:
committed by
GitHub
parent
b9a1227e47
commit
3ac2ac0982
39
pyscript.core/test/all-done.html
Normal file
39
pyscript.core/test/all-done.html
Normal file
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="../dist/core.css">
|
||||
<script type="module">
|
||||
import '../dist/core.js';
|
||||
|
||||
document.body.append('loading ...', document.createElement('br'));
|
||||
|
||||
addEventListener(
|
||||
'py:all-done',
|
||||
() => {
|
||||
document.body.append('all executed');
|
||||
},
|
||||
{ once: true }
|
||||
);
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<script type="py">
|
||||
print(1)
|
||||
</script>
|
||||
<py-script>
|
||||
print(2)
|
||||
</py-script>
|
||||
<py-script async>
|
||||
print(3)
|
||||
</py-script>
|
||||
<script type="py" worker>
|
||||
print(4)
|
||||
</script>
|
||||
<py-script async worker>
|
||||
print(5)
|
||||
</py-script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user