restore background?
This commit is contained in:
parent
9731f82267
commit
331a0fb13b
BIN
src/assets/images/bg/bg-1.png
Normal file
BIN
src/assets/images/bg/bg-1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 119 B |
BIN
src/assets/images/bg/bg0.png
Normal file
BIN
src/assets/images/bg/bg0.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 119 B |
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue