输入框修改为富文本,支持换行 (#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:
Void 2023-02-18 09:56:13 +08:00 committed by GitHub
parent c98a2a3cb8
commit ea887ad755
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -78,8 +78,10 @@ async function handleSubmit() {
}
function handleEnter(event: KeyboardEvent) {
if (event.key === 'Enter')
if (event.key === 'Enter' && !event.shiftKey) {
event.preventDefault()
handleSubmit()
}
}
function addMessage(
@ -189,7 +191,9 @@ watch(
</HoverButton>
<NInput
v-model:value="prompt"
placeholder="Type a message..."
type="textarea"
:autosize="{ minRows: 1, maxRows: 2 }"
placeholder="Ask me anything..."
@keypress="handleEnter"
/>
<NButton type="primary" :disabled="loading" @click="handleSubmit">