fix: add cli fit the window when resize

This commit is contained in:
tiny-craft 2023-10-31 17:57:54 +08:00
parent ca8403d784
commit 5a29a34ea1
1 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ onMounted(() => {
const { term, fitAddon } = newTerm()
termInst = term
fitAddonInst = fitAddon
// window.addEventListener('resize', resizeTerm)
window.addEventListener('resize', resizeTerm)
term.writeln('\r\n' + i18nGlobal.t('interface.cli_welcome'))
// term.write('\x1b[4h') // insert mode
@ -71,7 +71,7 @@ onMounted(() => {
})
onUnmounted(() => {
// window.removeEventListener('resize', resizeTerm)
window.removeEventListener('resize', resizeTerm)
EventsOff(`cmd:output:${props.name}`)
termInst.dispose()
termInst = null