浏览代码

解决新建聊天无法加载主页的问题

mrh 1 年之前
父节点
当前提交
c38c0c696d
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      src/App.vue

+ 5 - 4
src/App.vue

@@ -46,10 +46,7 @@
         shape="circle"
         title="新建对话"
         size="large"
-        @click="
-          messages = [];
-          nextTick(() => startChat = true);
-        "
+        @click="onNewChat"
       />
     </div>
     <McLayoutSender>
@@ -201,6 +198,10 @@ const onItemClick = (item:any) => {
   }
 };
 
+const onNewChat = () => {
+  messages.value = [];
+  startChat.value = false;
+};
 const themeChange = () => {
   if (themeService) {
     theme.value = themeService.currentTheme.id === 'infinity-theme' ? 'light' : 'dark';