You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

HomeView.vue 951 B

3 weken geleden
1234567891011121314151617181920212223242526272829303132333435363738
  1. <script setup lang="ts">
  2. import QueryBox from "@/components/QueryBox.vue";
  3. import {ref} from "vue";
  4. import {usePromptStore} from "@/stores/prompt.ts";
  5. import {useRouter} from "vue-router";
  6. const promptStore = usePromptStore();
  7. const router = useRouter();
  8. const query = ref('');
  9. const submitQuery = async () => {
  10. promptStore.setPrompt(query.value);
  11. await router.push('/response');
  12. }
  13. const updateQuery = (v: string) => {
  14. query.value = v;
  15. }
  16. </script>
  17. <template>
  18. <main class="relative flex flex-1">
  19. <div class="absolute inset-x-0 top-[42%] -translate-y-1/2 px-1">
  20. <QueryBox @on-change="updateQuery" @submit="submitQuery" />
  21. <p class="mt-3 text-center text-[11px] text-muted">
  22. Enter to send
  23. <span class="mx-1.5 text-muted/50">·</span>
  24. <kbd class="rounded border border-line px-1 py-px font-mono text-[10px]">/</kbd>
  25. to focus
  26. </p>
  27. </div>
  28. </main>
  29. </template>
  30. <style scoped>
  31. </style>