Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit ea887ad

Browse files
输入框修改为富文本,支持换行 (#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 <[email protected]>
1 parent c98a2a3 commit ea887ad

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/components/business/Chat/index.vue

+6-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ async function handleSubmit() {
7878
}
7979
8080
function handleEnter(event: KeyboardEvent) {
81-
if (event.key === 'Enter')
81+
if (event.key === 'Enter' && !event.shiftKey) {
82+
event.preventDefault()
8283
handleSubmit()
84+
}
8385
}
8486
8587
function addMessage(
@@ -189,7 +191,9 @@ watch(
189191
</HoverButton>
190192
<NInput
191193
v-model:value="prompt"
192-
placeholder="Type a message..."
194+
type="textarea"
195+
:autosize="{ minRows: 1, maxRows: 2 }"
196+
placeholder="Ask me anything..."
193197
@keypress="handleEnter"
194198
/>
195199
<NButton type="primary" :disabled="loading" @click="handleSubmit">

0 commit comments

Comments
 (0)