Commit 948d2592 authored by nagayama15's avatar nagayama15

Display result using Vue.js

parent 8b68ba49
...@@ -6,17 +6,33 @@ ...@@ -6,17 +6,33 @@
<title>Watermark Server</title> <title>Watermark Server</title>
</head> </head>
<body> <body>
<div id="root">
<h1>Watermark Server</h1> <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> <script>
(async () => { (async () => {
// Import wasm module
const wasm = await WebAssembly.instantiateStreaming( const wasm = await WebAssembly.instantiateStreaming(
fetch("wasm/add.wasm") fetch("wasm/add.wasm")
); );
const { add2, add3 } = wasm.instance.exports; const { add2, add3 } = wasm.instance.exports;
console.log(add2(42, 88)); // Mount vue
console.log(add3(42, 88, 64)); const data = {
result1: add2(42, 88),
result2: add3(42, 88, 64)
};
const app = new Vue({
el: "#root",
data
});
})(); })();
</script> </script>
</body> </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