53 lines
1.0 KiB
Vue
53 lines
1.0 KiB
Vue
<script lang="ts">
|
|
import vue from '@vitejs/plugin-vue';
|
|
import type { FormSubmitEvent } from '@nuxt/ui';
|
|
import axios from 'axios';
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
hint: '',
|
|
guesses: [],
|
|
};
|
|
},
|
|
|
|
mounted () {
|
|
axios
|
|
.get('/api/fetch_tla/en')
|
|
.then(response => {
|
|
this.hint = response.data.hint;
|
|
this.guesses = response.data.guesses;
|
|
});
|
|
}
|
|
}
|
|
|
|
async function onSubmit(event: FormSubmitEvent<Schema>) {
|
|
console.log(event.data)
|
|
}
|
|
|
|
</script>
|
|
|
|
<template>
|
|
<UCard>
|
|
<template #header>
|
|
{{ this.hint }}
|
|
</template>
|
|
|
|
<template v-for="guess in guesses">
|
|
{{ guess }}
|
|
</template>
|
|
|
|
<template #footer>
|
|
<UForm :schema="schema" :state="state" class="space-y-4" @submit="onSubmit">
|
|
<UInput
|
|
placeholder="Three Letter Abbreviation"
|
|
/>
|
|
|
|
<UButton type="submit">
|
|
Submit
|
|
</UButton>
|
|
</UForm>
|
|
|
|
</template>
|
|
</UCard>
|
|
</template> |