From e295922209fb87c6dcd68ea1560fd16c3e6d808c Mon Sep 17 00:00:00 2001 From: dongyukun <1208714201@qq.com> Date: 星期五, 27 六月 2025 09:36:51 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/feature/ai' --- src/views/ai/chat/index/components/role/RoleCategoryList.vue | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 53 insertions(+), 0 deletions(-) diff --git a/src/views/ai/chat/index/components/role/RoleCategoryList.vue b/src/views/ai/chat/index/components/role/RoleCategoryList.vue new file mode 100644 index 0000000..c02126d --- /dev/null +++ b/src/views/ai/chat/index/components/role/RoleCategoryList.vue @@ -0,0 +1,53 @@ +<template> + <div class="category-list"> + <div class="category" v-for="category in categoryList" :key="category"> + <el-button + plain + round + size="small" + :type="category === active ? 'primary' : ''" + @click="handleCategoryClick(category)" + > + {{ category }} + </el-button> + </div> + </div> +</template> +<script setup lang="ts"> +import { PropType } from 'vue' + +// 定义属性 +defineProps({ + categoryList: { + type: Array as PropType<string[]>, + required: true + }, + active: { + type: String, + required: false, + default: '全部' + } +}) + +// 定义回调 +const emits = defineEmits(['onCategoryClick']) + +/** 处理分类点击事件 */ +const handleCategoryClick = async (category: string) => { + emits('onCategoryClick', category) +} +</script> +<style scoped lang="scss"> +.category-list { + display: flex; + flex-direction: row; + flex-wrap: wrap; + align-items: center; + + .category { + display: flex; + flex-direction: row; + margin-right: 10px; + } +} +</style> -- Gitblit v1.9.3