Skip to content

Commit 916e5a9

Browse files
perf: 优化
perf: 优化
2 parents a1383c3 + 057449e commit 916e5a9

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

ui/src/components/ai-chat/OperationButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</el-text>
66
</div>
77
<div>
8-
<el-tooltip effect="dark" content="重新生成" placement="top">
8+
<el-tooltip effect="dark" content="换个答案" placement="top">
99
<el-button text @click="regeneration">
1010
<AppIcon iconName="VideoPlay"></AppIcon>
1111
</el-button>

ui/src/layout/hooks/useResize.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { watch, onBeforeMount, onMounted, onBeforeUnmount } from 'vue'
1+
import { nextTick, onBeforeMount, onMounted, onBeforeUnmount } from 'vue'
22
import { useRoute } from 'vue-router'
33
import useStore from '@/stores'
44
import { DeviceType } from '@/enums/common'
@@ -9,7 +9,7 @@ const WIDTH = 600
99
export default () => {
1010
const { common } = useStore()
1111
const _isMobile = () => {
12-
const rect = document.body.getBoundingClientRect()
12+
const rect = document.body?.getBoundingClientRect()
1313
return rect.width - 1 < WIDTH
1414
}
1515

@@ -25,9 +25,11 @@ export default () => {
2525
})
2626

2727
onMounted(() => {
28-
if (_isMobile()) {
29-
common.toggleDevice(DeviceType.Mobile)
30-
}
28+
nextTick(() => {
29+
if (_isMobile()) {
30+
common.toggleDevice(DeviceType.Mobile)
31+
}
32+
})
3133
})
3234

3335
onBeforeUnmount(() => {

0 commit comments

Comments
 (0)