1- <script setup lang="ts">
2- import Prism from ' vue-prism-component'
3-
4- const server = ` // server.ts
5- import { Elysia, t } from 'elysia'
6-
7- const app = new Elysia()
8- .patch(
9- '/user/age',
10- ({ body }) => signIn(body),
11- {
12- body: t.Object({
13- name: t.String(),
14- age: t.Number()
15- })
16- }
17- )
18- .listen(80)
19-
20- export type App = typeof app `
21-
22- const client = ` // client.ts
23- import { edenTreaty } from '@elysiajs/eden'
24- import type { App } from 'server'
25-
26- const eden = edenTreaty<App>('http://localhost')
27-
28- await eden.user.age.patch({
29- name: 'saltyaom',
30- age: '21'
31- }) `
32- </script >
33-
341<template >
352 <section class =" flex flex-col justify-center items-center w-full max-w-6xl mx-auto py-4" >
363 <!-- <h3 class="text-2xl mr-auto md:mx-auto font-medium text-gray-400">
@@ -54,25 +21,20 @@ await eden.user.age.patch({
5421
5522 <section class =" flex flex-col lg:flex-row gap-8 w-full max-w-5xl my-8" >
5623 <div class =" w-full !text-base !font-mono rounded-xl" >
57- <slot name =" server" >test </slot >
24+ <slot name =" server" ></slot >
5825 </div >
5926 <div class =" relative w-full !text-base !font-mono rounded-xl" >
6027 <slot name =" client" ></slot >
61- <!-- <div
62- class="absolute p-1 rounded bg-red-400/25"
63- style="
64- top: 13.5em;
65- left: 6.375em;
66- width: 2.5em;
28+ <div class =" absolute p-1 rounded bg-red-400/25" style ="
29+ top : 13.2em ;
30+ left : 5.9em ;
31+ width : 2.2em ;
6732 height : 1.375em ;
68- "
69- />
70- <p
71- class="absolute px-3 py-1.5 rounded bg-white dark:bg-gray-700 border dark:border-gray-600"
72- style="top: 15.25em; left: 3.25em"
73- >
33+ " />
34+ <p class =" absolute px-3 py-1.5 rounded bg-white dark:bg-gray-700 border dark:border-gray-600"
35+ style =" top : 15.25em ; left : 3.25em " >
7436 Type 'string' is not assignable to type 'number'
75- </p> -->
37+ </p >
7638 </div >
7739 </section >
7840 </section >
0 commit comments