perf(Terminal):优化终端初始化操作的时机

This commit is contained in:
妙码生花 2024-10-27 16:27:46 +08:00
parent 77327601e1
commit 8c6e17ac85
2 changed files with 8 additions and 7 deletions

View File

@ -6,23 +6,20 @@
<script setup lang="ts">
import { onMounted, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import iconfontInit from '/@/utils/iconfont'
import { useRoute } from 'vue-router'
import { setTitleFromRoute } from '/@/utils/common'
import { useConfig } from '/@/stores/config'
import { useTerminal } from '/@/stores/terminal'
import { setTitleFromRoute } from '/@/utils/common'
import iconfontInit from '/@/utils/iconfont'
// modules import mark, Please do not remove.
const config = useConfig()
const route = useRoute()
const terminal = useTerminal()
const config = useConfig()
// element
const { getLocaleMessage } = useI18n()
const lang = getLocaleMessage(config.lang.defaultLang) as any
onMounted(() => {
iconfontInit()
terminal.init()
// Modules onMounted mark, Please do not remove.
})

View File

@ -182,7 +182,7 @@
<script setup lang="ts">
import type { TimelineItemProps } from 'element-plus'
import { ElMessageBox, ElScrollbar } from 'element-plus'
import { ref, reactive, nextTick } from 'vue'
import { nextTick, onMounted, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import { postChangeTerminalConfig } from '/@/api/common'
import FormItem from '/@/components/formItem/index.vue'
@ -313,6 +313,10 @@ const getSourceContent = (type: SourceType) => {
}
return content
}
onMounted(() => {
terminal.init()
})
</script>
<style scoped lang="scss">