restore background?

This commit is contained in:
KUN1007 2023-05-27 14:42:36 +08:00
parent 9731f82267
commit 331a0fb13b
3 changed files with 11 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

View file

@ -21,6 +21,11 @@ const handelChangeImage = (index: number) => {
watch(showKUNGalgameBackground, () => {
localStorage.setItem('KUNGalgame-background', showKUNGalgameBackground.value)
})
//
const handleRestore = () => {
handelChangeImage(0)
}
</script>
<template>
@ -30,7 +35,7 @@ watch(showKUNGalgameBackground, () => {
<li>
<span>{{ $t('header.settings.preset') }}</span>
<!-- 预设背景集 -->
<ul class="kungalgame-reset-bg">
<ul class="kungalgame-restore-bg">
<li v-for="kun in backgroundImages" :key="kun.index">
<img
:src="kun.image"
@ -50,7 +55,9 @@ watch(showKUNGalgameBackground, () => {
<button>{{ $t('header.settings.confirm') }}</button>
</div>
</div>
<button class="reset-bg">{{ $t('header.settings.restore') }}</button>
<button class="restore-bg" @click="handleRestore">
{{ $t('header.settings.restore') }}
</button>
</li>
</ul>
</div>
@ -78,7 +85,7 @@ watch(showKUNGalgameBackground, () => {
margin: 10px 0;
}
/* 背景图片略缩图三行三列 grid */
.kungalgame-reset-bg {
.kungalgame-restore-bg {
display: grid;
justify-content: center;
grid-template-columns: repeat(3, 80px);
@ -145,7 +152,7 @@ watch(showKUNGalgameBackground, () => {
}
}
}
.reset-bg {
.restore-bg {
font-size: 15px;
cursor: pointer;
height: 30px;