Skip to content

MessageActions 消息操作栏 ​

用于配合 ChatMessage 的 #actions 插槽,提供复制、重新生成、点赞/点踩、编辑及多版本分支切换。

基础用法 ​

1 / 3
<script setup>
import { ref } from 'vue'
import MessageActions from '@/vue/components/MessageActions.vue'

const feedback = ref(null)
const branch = ref(1)
</script>

<template>
  <MessageActions
    content="这是可复制的 AI 回复内容"
    regenerable
    editable
    :feedback="feedback"
    :branch-index="branch"
    :branch-total="3"
    @feedback="(val) => (feedback = val)"
    @branch-change="(idx) => (branch = idx)"
  />
</template>

API ​

属性名说明类型默认值
content待复制文本string''
copyable显示复制按钮booleantrue
regenerable显示重新生成按钮booleanfalse
editable显示编辑按钮booleanfalse
feedbackable显示点赞/点踩按钮booleantrue
branchIndex / branchTotal当前分支序号 / 总数number1 / 0

基于 MIT 许可发布