fix: frontend

This commit is contained in:
2025-01-04 13:17:29 +07:00
parent 081ebf2b28
commit 244feefb29
7 changed files with 33 additions and 42 deletions

View File

@@ -1,9 +1,7 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import {GreetService} from "../../bindings/app";
import {Events} from "@wailsio/runtime";
defineProps<{ msg: string }>()
import * as PostService from "../../bindings/app/internal/services/postservice";
const name = ref('')
const result = ref('Please enter your name below 👇')
@@ -14,25 +12,18 @@ const doGreet = () => {
if (!localName) {
localName = 'anonymous';
}
GreetService.Greet(localName).then((resultValue: string) => {
result.value = resultValue;
}).catch((err: Error) => {
console.log(err);
});
}
onMounted(() => {
Events.On('time', (timeValue: { data: string }) => {
time.value = timeValue.data;
});
onMounted(async () => {
console.log(await PostService.GetById(5))
})
</script>
<template>
<h1>{{ msg }}</h1>
<h1>Kuzbass</h1>
<div class="result">{{ result }}</div>
<div class="result"></div>
<div class="card">
<div class="input-box">
<input class="input" v-model="name" type="text" autocomplete="off"/>
@@ -42,6 +33,6 @@ onMounted(() => {
<div class="footer">
<div><p>Click on the Wails logo to learn more</p></div>
<div><p>{{ time }}</p></div>
<div><p></p></div>
</div>
</template>