Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/renderer/src/views/ChatTabView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
>
<div
v-show="chatStore.isSidebarOpen"
ref="sidebarRef"
:class="[
'w-60 max-w-60 h-full fixed z-20 lg:relative',
langStore.dir === 'rtl' ? 'right-0' : 'left-0'
Expand Down Expand Up @@ -52,7 +53,8 @@
<script setup lang="ts">
import { defineAsyncComponent } from 'vue'
import { useChatStore } from '@/stores/chat'
import { computed, watch } from 'vue'
import { computed, watch, ref } from 'vue'
import { onClickOutside } from '@vueuse/core'
import { useSettingsStore } from '@/stores/settings'
import { RENDERER_MODEL_META } from '@shared/presenter'
import { useArtifactStore } from '@/stores/artifact'
Expand Down Expand Up @@ -100,6 +102,15 @@ watch(
{ deep: true }
)

// 点击外部区域关闭侧边栏
const sidebarRef = ref<HTMLElement>()

onClickOutside(sidebarRef, () => {
if (chatStore.isSidebarOpen) {
chatStore.isSidebarOpen = false
}
})

const activeModel = computed(() => {
let model: RENDERER_MODEL_META | undefined
const modelId = chatStore.activeThread?.settings.modelId
Expand Down