mirror of
https://github.com/konsoletyper/teavm.git
synced 2024-11-27 01:30:35 +08:00
samples: add html file for module demo
This commit is contained in:
parent
271545a3ef
commit
abb1ea0070
26
samples/module-test/src/main/webapp/index.html
Normal file
26
samples/module-test/src/main/webapp/index.html
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Test module</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||||
|
<script type="module" charset="utf-8">
|
||||||
|
import { foo, bar } from "./js/module-test.js"
|
||||||
|
|
||||||
|
document.body.onload = () => {
|
||||||
|
let fooButton = document.getElementById("foo");
|
||||||
|
fooButton.onclick = () => {
|
||||||
|
foo();
|
||||||
|
}
|
||||||
|
let barButton = document.getElementById("bar");
|
||||||
|
let barArgInput = document.getElementById("bar-arg");
|
||||||
|
barButton.onclick = () => {
|
||||||
|
alert(bar(parseInt(barArgInput.value)));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p><button id="foo">call foo (result in console)</button></p>
|
||||||
|
<p><button id="bar">call bar: </button> <input id="bar-arg" type="text" value="23"></p>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -50,7 +50,7 @@ tasks.war {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tasks.assemble {
|
tasks.assemble {
|
||||||
dependsOn(tasks.generateWasi,)
|
dependsOn(tasks.generateWasi)
|
||||||
}
|
}
|
||||||
|
|
||||||
val buildNativeLinux by tasks.register<Exec>("buildNativeLinux") {
|
val buildNativeLinux by tasks.register<Exec>("buildNativeLinux") {
|
||||||
|
Loading…
Reference in New Issue
Block a user