chore: eslint 配置
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user