2021-11-21 15:58:47 +00:00
|
|
|
<script setup>
|
|
|
|
const a = ref(100)
|
|
|
|
const b = ref(250)
|
|
|
|
|
|
|
|
const { data } = await useAsyncData('sum',
|
|
|
|
() => $fetch('/api/sum', { params: { a: a.value, b: b.value } })
|
|
|
|
)
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2022-03-30 15:59:28 +00:00
|
|
|
<NuxtExampleLayout example="wasm">
|
2022-03-23 08:44:36 +00:00
|
|
|
<p>
|
|
|
|
<code>a = 100</code>
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<code>b = 250</code>
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
Computation performed server-side with WASM :
|
|
|
|
<br>
|
|
|
|
<code>{{ a }} + {{ b }} = {{ data.sum }}</code>
|
|
|
|
</p>
|
2021-12-23 19:27:08 +00:00
|
|
|
</NuxtExampleLayout>
|
2021-11-21 15:58:47 +00:00
|
|
|
</template>
|