fix: 兼容低版本浏览器消息复制
- 为 Chrome 90 增加剪贴板兼容回退 - 统一聊天与智能体试运行的原色对勾反馈
This commit is contained in:
@@ -21,6 +21,7 @@ import ChatToolCard from './ChatToolCard.vue';
|
||||
const props = defineProps<{
|
||||
approvalLoading?: boolean;
|
||||
copyable?: boolean;
|
||||
copyAction?: (item: ChatTimelineMessageItem) => boolean | Promise<boolean>;
|
||||
regenerable?: boolean;
|
||||
regenerateDisabled?: boolean;
|
||||
assistantActionsVisible?: boolean;
|
||||
@@ -118,6 +119,14 @@ function updateThinkingExpanded(partId: string, expanded: boolean) {
|
||||
part.expanded = expanded;
|
||||
}
|
||||
}
|
||||
|
||||
function handleCopyAction() {
|
||||
const item = messageItem.value;
|
||||
if (!item || !props.copyAction) {
|
||||
return false;
|
||||
}
|
||||
return props.copyAction(item);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -161,6 +170,7 @@ function updateThinkingExpanded(partId: string, expanded: boolean) {
|
||||
:align="messageItem.role === 'user' ? 'end' : 'start'"
|
||||
:allow-copy="copyable"
|
||||
:allow-regenerate="regenerable"
|
||||
:copy-action="copyAction ? handleCopyAction : undefined"
|
||||
:disabled-variant-next="disabledVariantNext"
|
||||
:disabled-variant-previous="disabledVariantPrevious"
|
||||
:regenerate-disabled="regenerateDisabled"
|
||||
|
||||
Reference in New Issue
Block a user