mirror of
https://github.com/ArthurDanjou/trpc-nuxt.git
synced 2026-01-31 04:07:55 +01:00
update router location
This commit is contained in:
@@ -1,18 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
const { data, pending } = useLazyTrpcQuery('getUser', {
|
||||
const client = useClient()
|
||||
const data = await client.query('getUser', {
|
||||
name: 'roberts',
|
||||
})
|
||||
|
||||
watchEffect(() => {
|
||||
console.log(data.value)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="pending">
|
||||
Loading...
|
||||
</div>
|
||||
<div v-else>
|
||||
<div>
|
||||
{{ data }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user