From eb519cc5ad18ff2e06f71e1d417e16d2a8e4381b Mon Sep 17 00:00:00 2001 From: Hao Wu Date: Tue, 21 Mar 2023 15:00:32 +0800 Subject: [PATCH] fix slider in mobile --- web/src/views/chat/index.vue | 49 +++++++++++++++--------------------- 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/web/src/views/chat/index.vue b/web/src/views/chat/index.vue index a4031c72..fa4c2436 100644 --- a/web/src/views/chat/index.vue +++ b/web/src/views/chat/index.vue @@ -2,7 +2,7 @@ import { computed, onMounted, onUnmounted, ref, watch } from 'vue' import { v4 as uuidv4 } from 'uuid' import { useRoute } from 'vue-router' -import { NButton, NCard, NInput, NModal, NSlider, useDialog, useMessage } from 'naive-ui' +import { NButton, NCard, NInput, NInputNumber, NModal, NSlider, useDialog, useMessage } from 'naive-ui' import html2canvas from 'html2canvas' import { debounce } from 'lodash' import { Message } from './components' @@ -30,7 +30,7 @@ useCopyCode() const { isMobile } = useBasicLayout() const { addChat, updateChat, updateChatPartial, updateChatText } = useChat() const { scrollRef, scrollToBottom } = useScroll() -const { usingContext, toggleUsingContext } = useUsingContext() +const { usingContext } = useUsingContext() // session uuid const { uuid } = route.params as { uuid: string } const sessionUuid = uuid @@ -42,7 +42,7 @@ const loading = ref(false) const sliderValue = ref(10) -const throttledUpdate = debounce(async (newValue: number, oldValue: number) => { +const throttledUpdate = debounce(async (newValue: number, _: number) => { await setChatSessionMaxContextLength(uuid, newValue) }, 200) @@ -507,28 +507,25 @@ onUnmounted(() => { --> +
上下文数量, 默认10 (会话开始的2条+ 最近的8条)
+ + + Footer + -->
-
+