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