mirror of
https://github.com/ArthurDanjou/trpc-nuxt.git
synced 2026-01-27 10:20:39 +01:00
update types
This commit is contained in:
7
packages/playground/.gitignore
vendored
7
packages/playground/.gitignore
vendored
@@ -1,7 +0,0 @@
|
||||
node_modules
|
||||
*.log*
|
||||
.nuxt
|
||||
.nitro
|
||||
.cache
|
||||
.output
|
||||
.env
|
||||
@@ -1,42 +0,0 @@
|
||||
# Nuxt 3 Minimal Starter
|
||||
|
||||
Look at the [nuxt 3 documentation](https://v3.nuxtjs.org) to learn more.
|
||||
|
||||
## Setup
|
||||
|
||||
Make sure to install the dependencies:
|
||||
|
||||
```bash
|
||||
# yarn
|
||||
yarn install
|
||||
|
||||
# npm
|
||||
npm install
|
||||
|
||||
# pnpm
|
||||
pnpm install --shamefully-hoist
|
||||
```
|
||||
|
||||
## Development Server
|
||||
|
||||
Start the development server on http://localhost:3000
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
## Production
|
||||
|
||||
Build the application for production:
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
Locally preview production build:
|
||||
|
||||
```bash
|
||||
npm run preview
|
||||
```
|
||||
|
||||
Checkout the [deployment documentation](https://v3.nuxtjs.org/docs/deployment) for more information.
|
||||
@@ -1,18 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
const { data, error } = useTrpcQuery('hello')
|
||||
|
||||
// const d = useLazyAsyncData('asd', () => $fetch('/api/hello'))
|
||||
|
||||
watch(data, (val) => {
|
||||
console.log('val', val)
|
||||
console.log('error', error.value)
|
||||
}, {
|
||||
immediate: true,
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
{{ data }}
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,6 +0,0 @@
|
||||
import { defineNuxtConfig } from 'nuxt'
|
||||
|
||||
// https://v3.nuxtjs.org/api/configuration/nuxt.config
|
||||
export default defineNuxtConfig({
|
||||
modules: ['trpc-nuxt'],
|
||||
})
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"name": "playground",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "nuxt build",
|
||||
"dev": "nuxt dev",
|
||||
"generate": "nuxt generate",
|
||||
"preview": "nuxt preview",
|
||||
"prepare": "nuxt prepare"
|
||||
},
|
||||
"dependencies": {
|
||||
"trpc-nuxt": "link:../trpc",
|
||||
"zod": "^3.16.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"nuxt": "3.0.0-rc.3"
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
// generated by trpc-nuxt
|
||||
import * as trpc from '@trpc/server'
|
||||
|
||||
export const router = trpc
|
||||
.router()
|
||||
.query('hello', {
|
||||
resolve: () => 'world',
|
||||
});
|
||||
|
||||
export type Router = typeof router
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"extends": "./.nuxt/tsconfig.json"
|
||||
}
|
||||
Reference in New Issue
Block a user