后期修改完善,上线版本
This commit is contained in:
@ -9,11 +9,25 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 从 sessionStorage 获取缓存数据的辅助函数
|
||||
function getCachedMode() {
|
||||
try {
|
||||
const cachedData = sessionStorage.getItem('launches_search_cache');
|
||||
if (cachedData) {
|
||||
const parsedData = JSON.parse(cachedData);
|
||||
return parsedData.currentMode || 'Daily';
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('获取缓存的模式失败', e);
|
||||
}
|
||||
return 'Daily';
|
||||
}
|
||||
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
default: 'Daily'
|
||||
default: getCachedMode,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -29,22 +43,22 @@ export default {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.switch-box {
|
||||
padding: 22px 40px;
|
||||
padding: 12px 40px;
|
||||
border-radius: 12px;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 10px 30px 0 #0000000d;
|
||||
.diver {
|
||||
width: 1px;
|
||||
height: 36px;
|
||||
margin-left: 70px;
|
||||
margin-right: 70px;
|
||||
height: 29px;
|
||||
margin-left: 33px;
|
||||
margin-right: 33px;
|
||||
border-left-width: 1px;
|
||||
border-left-style: solid;
|
||||
border-left-color: #E2E8F0;
|
||||
}
|
||||
.item-text {
|
||||
font-size: 24px;
|
||||
font-family: 'Poppins-Regular', serif;
|
||||
font-family: 'Poppins-Regular';
|
||||
color: #3A4A65;
|
||||
&:active {
|
||||
opacity: 0.8;
|
||||
@ -53,7 +67,7 @@ export default {
|
||||
.active {
|
||||
color: #7B61FF;
|
||||
font-weight: 900 !important;
|
||||
font-family: 'Poppins-Bold', serif;
|
||||
font-family: 'Poppins-Bold';
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user