mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 16:43:55 +00:00
1a7b570c82
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
25 lines
482 B
Vue
25 lines
482 B
Vue
<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>
|
|
<NuxtExampleLayout example="wasm">
|
|
<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>
|
|
</NuxtExampleLayout>
|
|
</template>
|