Skip to content

Commit a5da43e

Browse files
committed
feat: 优化对话框组件的条件渲染逻辑,使用isAntDesignX变量替代路由查询参数
1 parent 94d2018 commit a5da43e

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

docs/src/App.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<router-view />
77
</div>
88
<div class="right-panel" :class="{ collapsed: !showTinyRobot }">
9-
<tiny-robot-chat v-if="route.query.dialog !== 'ant'" />
10-
<ant-design-x v-if="route.query.dialog === 'ant'" />
9+
<tiny-robot-chat v-if="!isAntDesignX" />
10+
<ant-design-x v-else />
1111
</div>
1212
<IconAi @click="showTinyRobot = !showTinyRobot" class="style-settings-icon"></IconAi>
1313
<tiny-dialog-box
@@ -47,10 +47,9 @@ import { IconAi } from '@opentiny/tiny-robot-svgs'
4747
import { provide, reactive, ref } from 'vue'
4848
import { $local, isEnvLLMDefined, isLocalLLMDefined } from './composable/utils'
4949
import { createMessageChannelServerTransport } from '@opentiny/next-sdk'
50-
import { useRoute } from 'vue-router' // 导入useRoute来获取路由信息
5150
5251
// 获取当前路由信息
53-
const route = useRoute()
52+
const isAntDesignX = location.href.includes('ant')
5453
5554
const boxVisibility = ref(false)
5655
const formRef = ref()

0 commit comments

Comments
 (0)