mirror of
https://github.com/ArthurDanjou/trpc-nuxt.git
synced 2026-01-14 12:14:40 +01:00
update readme
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
const { data, error } = await useTrpcQuery('getUser', {
|
||||
name: 'john',
|
||||
name: 'johns',
|
||||
})
|
||||
|
||||
watchEffect(() => {
|
||||
@@ -10,5 +10,5 @@ watchEffect(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>hello</div>
|
||||
<div>{{ data.name }}</div>
|
||||
</template>
|
||||
|
||||
@@ -13,4 +13,20 @@ export const router = trpc
|
||||
resolve: () => 'world',
|
||||
})
|
||||
|
||||
// optional
|
||||
export const createContext = () => {
|
||||
// ...
|
||||
return {
|
||||
/** context data */
|
||||
}
|
||||
}
|
||||
|
||||
// optional
|
||||
export const responseMeta = () => {
|
||||
// ...
|
||||
return {
|
||||
// { headers: ... }
|
||||
}
|
||||
}
|
||||
|
||||
export type Router = typeof router
|
||||
|
||||
Reference in New Issue
Block a user