Add frequently used prompt function.

This commit is contained in:
Rafi
2023-03-09 17:39:45 +08:00
parent 8340edbf40
commit 052f5299a0
4 changed files with 237 additions and 5 deletions

View File

@@ -1,4 +1,6 @@
<script setup>
import Prompt from "~/components/Prompt.vue";
definePageMeta({
middleware: ["auth"]
})
@@ -140,6 +142,10 @@ const showSnackbar = (text) => {
snackbar.value = true
}
const editor = ref(null)
const usePrompt = (prompt) => {
editor.value.usePrompt(prompt)
}
</script>
@@ -188,6 +194,7 @@ const showSnackbar = (text) => {
<Welcome v-else />
<v-footer app class="d-flex flex-column">
<div class="px-md-16 w-100 d-flex align-center">
<Prompt v-show="!fetchingResponse" :use-prompt="usePrompt" />
<v-btn
v-show="fetchingResponse"
icon="close"
@@ -195,7 +202,7 @@ const showSnackbar = (text) => {
class="mr-3"
@click="stop"
></v-btn>
<MsgEditor :send-message="send" :disabled="fetchingResponse" :loading="fetchingResponse" />
<MsgEditor ref="editor" :send-message="send" :disabled="fetchingResponse" :loading="fetchingResponse" />
</div>
<div class="px-4 py-2 text-disabled text-caption font-weight-light text-center w-100">