fix 优化对话标题显示方法
This commit is contained in:
parent
a292e69b22
commit
b81f31c652
@ -25,7 +25,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="header__center">
|
||||
<div @click="console.log(currentChat)">{{ currentChat?.title }}</div>
|
||||
<div @click="console.log(currentChat)" class="center-title">
|
||||
{{ currentChat?.title }}
|
||||
</div>
|
||||
<slot name="header-center"></slot>
|
||||
</div>
|
||||
<div class="header__right">
|
||||
@ -304,6 +306,11 @@ const renameChat = async (data) => {
|
||||
return;
|
||||
}
|
||||
|
||||
// 最长 30个字符,自动截断
|
||||
if (title.length > 30) {
|
||||
title = title.slice(0, 30);
|
||||
}
|
||||
|
||||
try {
|
||||
// 调用API更新对话
|
||||
await threadApi.updateThread(chatId, title);
|
||||
@ -797,10 +804,17 @@ const mergeMessageChunk = (chunks) => {
|
||||
padding: 1rem;
|
||||
border-bottom: 1px solid var(--main-light-3);
|
||||
|
||||
.header__left, .header__right {
|
||||
.header__left, .header__right, .header__center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.center-title {
|
||||
max-width: 200px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-btn {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user