输入框修改为富文本,支持换行 (#53)
* add Dockerfile * update Readme.md * Fixed : Docker log file * Update vite.config.ts * chore: code merge, update README.md * chore: update GitHub workflow * fix: 输入框修改为富文本,支持换行 * chore: 更新.gitignore * Update index.vue --------- Co-authored-by: Redon <790348264@qq.com>
This commit is contained in:
parent
c98a2a3cb8
commit
ea887ad755
|
@ -78,8 +78,10 @@ async function handleSubmit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleEnter(event: KeyboardEvent) {
|
function handleEnter(event: KeyboardEvent) {
|
||||||
if (event.key === 'Enter')
|
if (event.key === 'Enter' && !event.shiftKey) {
|
||||||
|
event.preventDefault()
|
||||||
handleSubmit()
|
handleSubmit()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addMessage(
|
function addMessage(
|
||||||
|
@ -189,7 +191,9 @@ watch(
|
||||||
</HoverButton>
|
</HoverButton>
|
||||||
<NInput
|
<NInput
|
||||||
v-model:value="prompt"
|
v-model:value="prompt"
|
||||||
placeholder="Type a message..."
|
type="textarea"
|
||||||
|
:autosize="{ minRows: 1, maxRows: 2 }"
|
||||||
|
placeholder="Ask me anything..."
|
||||||
@keypress="handleEnter"
|
@keypress="handleEnter"
|
||||||
/>
|
/>
|
||||||
<NButton type="primary" :disabled="loading" @click="handleSubmit">
|
<NButton type="primary" :disabled="loading" @click="handleSubmit">
|
||||||
|
|
Loading…
Reference in New Issue