This commit is contained in:
2026-02-17 20:43:23 +03:00
commit 55d819f935
22 changed files with 5874 additions and 0 deletions

47
src/App.vue Normal file
View File

@@ -0,0 +1,47 @@
<script setup lang="ts">
import WebSocketComponent from '@/components/WebSocketComponent.vue'
import { ref } from 'vue'
const email = ref('vadim.olonin@gmail.com')
async function onSubmit() {
console.log('onSubmit')
try {
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ email: email.value }),
}
const res = await fetch('http://localhost:5173/login', options)
if (res.ok) {
const data = await res.json()
console.log(data)
}
} catch (error) {
console.log(error)
}
}
</script>
<template>
<div>
<div>chat</div>
<form @submit.prevent="onSubmit">
<div>login</div>
<div>
<input v-model="email" placeholder="email" type="email" />
<button>login</button>
</div>
</form>
<hr />
<div>
<WebSocketComponent />
</div>
</div>
</template>
<style scoped></style>