chore: eslint 配置
All checks were successful
/ depcheck (push) Successful in 2m19s
/ playwright (push) Successful in 1m45s
/ surge (push) Successful in 2m48s
/ build-and-deploy-to-vercel (push) Successful in 3m10s

This commit is contained in:
mini2024
2025-03-05 00:57:51 +08:00
parent feb7659b75
commit 2b7186ef69
35 changed files with 455 additions and 458 deletions

View File

@ -2,11 +2,11 @@
const structuredClone = window.structuredClone || ((obj) => JSON.parse(JSON.stringify(obj)));
const K_INITIAL_STATE = deepFreeze({
list: [] as Record<string, never>[],
page: 0,
loading: false,
complete: false,
error: null as unknown,
list: [] as Record<string, never>[],
loading: false,
page: 0,
});
let page3ShouldError = true;
@ -33,6 +33,8 @@ const refresh = () => {
loadMore();
};
type CurrentUse = 'use-intersection-observer-infinite-loading' | 'van-list';
async function loadMore() {
if (state.loading) return;
@ -59,8 +61,6 @@ async function loadMore() {
state.loading = false;
}
}
type CurrentUse = 'van-list' | 'use-intersection-observer-infinite-loading';
const currentUse = ref<CurrentUse>((sessionStorage.getItem('currentUse') as CurrentUse) || 'van-list');
watchEffect(() => {
sessionStorage.setItem('currentUse', currentUse.value);