支持终端主题与背景图设置

This commit is contained in:
chaos-zhu 2024-08-12 17:22:46 +08:00
parent 6ef28e7883
commit cff5f69518
2 changed files with 12 additions and 1 deletions

View File

@ -47,6 +47,14 @@
<el-image class="image" :src="url" />
</li>
</ul>
<div class="custom_background">
<el-input
v-model="backgroundUrl"
clearable
placeholder="自定义背景图片url"
autocomplete="on"
/>
</div>
</el-form-item>
</el-form>
<template #footer>
@ -141,6 +149,9 @@ const changeBackground = (url) => {
}
}
}
.custom_background {
width: 90%;
}
.dialog_footer {
display: flex;
justify-content: center;

View File

@ -62,7 +62,7 @@ watch(background, (newVal) => {
terminalRef.value.style.backgroundImage = `url(${ background.value })`
// terminalRef.value.style.backgroundImage = `linear-gradient(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15)), url(${ background.value })`
} else {
terminal.value.options.theme.background = theme.value.background
terminal.value.options.theme = theme.value
terminalRef.value.style.backgroundImage = null
}
})