mirror of
https://github.com/coaidev/coai.git
synced 2025-05-23 23:10:13 +09:00
add query feature
This commit is contained in:
parent
b264247d16
commit
2d931d4938
@ -32,12 +32,18 @@ function refreshScrollbar() {
|
||||
|
||||
onMounted(() => {
|
||||
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) => {
|
||||
if (e.key === "Enter") await send();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
Loading…
Reference in New Issue
Block a user