feat: base

This commit is contained in:
GogaCoder
2025-01-03 00:05:10 +07:00
commit 493ebacfcb
1224 changed files with 1648045 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import {GreetService} from "../../bindings/app";
import {Events} from "@wailsio/runtime";
defineProps<{ msg: string }>()
const name = ref('')
const result = ref('Please enter your name below 👇')
const time = ref('Listening for Time event...')
const doGreet = () => {
let localName = name.value;
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;
});
})
</script>
<template>
<h1>{{ msg }}</h1>
<div class="result">{{ result }}</div>
<div class="card">
<div class="input-box">
<input class="input" v-model="name" type="text" autocomplete="off"/>
<button class="btn" @click="doGreet">Greet</button>
</div>
</div>
<div class="footer">
<div><p>Click on the Wails logo to learn more</p></div>
<div><p>{{ time }}</p></div>
</div>
</template>