mirror of
https://github.com/coaidev/coai.git
synced 2025-05-25 07:50:15 +09:00
add query feature
This commit is contained in:
parent
b264247d16
commit
2d931d4938
@ -32,12 +32,18 @@ function refreshScrollbar() {
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (!inputEl.value) return;
|
if (!inputEl.value) return;
|
||||||
|
const param = new URLSearchParams(window.location.search);
|
||||||
|
const message = param.get("q");
|
||||||
|
if (message) {
|
||||||
|
input.value = message.trim();
|
||||||
|
window.history.replaceState({}, "", window.location.pathname);
|
||||||
|
send();
|
||||||
|
}
|
||||||
|
inputEl.value.focus();
|
||||||
(inputEl.value as HTMLElement).addEventListener("keydown", async (e) => {
|
(inputEl.value as HTMLElement).addEventListener("keydown", async (e) => {
|
||||||
if (e.key === "Enter") await send();
|
if (e.key === "Enter") await send();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
Loading…
Reference in New Issue
Block a user