后期修改完善,上线版本
This commit is contained in:
@ -1,9 +1,23 @@
|
||||
<script>
|
||||
// 从 sessionStorage 获取缓存数据的辅助函数
|
||||
function getCachedSortType() {
|
||||
try {
|
||||
const cachedData = sessionStorage.getItem('launches_search_cache');
|
||||
if (cachedData) {
|
||||
const parsedData = JSON.parse(cachedData);
|
||||
return parsedData.sortType || 'popular';
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('获取缓存的排序类型失败', e);
|
||||
}
|
||||
return 'popular';
|
||||
}
|
||||
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
default: 'popular'
|
||||
default: getCachedSortType
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
Reference in New Issue
Block a user