Commit 948d2592 authored by nagayama15's avatar nagayama15

Display result using Vue.js

parent 8b68ba49
......@@ -6,17 +6,33 @@
<title>Watermark Server</title>
</head>
<body>
<div id="root">
<h1>Watermark Server</h1>
<p>add2(42, 88) = {{ result1 }}</p>
<p>add3(42, 88, 64) = {{ result2 }}</p>
</div>
<script src="https://unpkg.com/vue"></script>
<script>
(async () => {
// Import wasm module
const wasm = await WebAssembly.instantiateStreaming(
fetch("wasm/add.wasm")
);
const { add2, add3 } = wasm.instance.exports;
console.log(add2(42, 88));
console.log(add3(42, 88, 64));
// Mount vue
const data = {
result1: add2(42, 88),
result2: add3(42, 88, 64)
};
const app = new Vue({
el: "#root",
data
});
})();
</script>
</body>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment