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