mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
docs(infinite-scroll): use proper equality check (#24767)
This commit is contained in:
@ -69,7 +69,7 @@ export class InfiniteScrollExample {
|
|||||||
|
|
||||||
// App logic to determine if all data is loaded
|
// App logic to determine if all data is loaded
|
||||||
// and disable the infinite scroll
|
// and disable the infinite scroll
|
||||||
if (data.length == 1000) {
|
if (data.length === 1000) {
|
||||||
event.target.disabled = true;
|
event.target.disabled = true;
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
@ -111,7 +111,7 @@ infiniteScroll.addEventListener('ionInfinite', function(event) {
|
|||||||
|
|
||||||
// App logic to determine if all data is loaded
|
// App logic to determine if all data is loaded
|
||||||
// and disable the infinite scroll
|
// and disable the infinite scroll
|
||||||
if (data.length == 1000) {
|
if (data.length === 1000) {
|
||||||
event.target.disabled = true;
|
event.target.disabled = true;
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
@ -164,7 +164,7 @@ const InfiniteScrollExample: React.FC = () => {
|
|||||||
pushData();
|
pushData();
|
||||||
console.log('Loaded data');
|
console.log('Loaded data');
|
||||||
ev.target.complete();
|
ev.target.complete();
|
||||||
if (data.length == 1000) {
|
if (data.length === 1000) {
|
||||||
setInfiniteDisabled(true);
|
setInfiniteDisabled(true);
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
@ -263,7 +263,7 @@ export class InfiniteScrollExample {
|
|||||||
|
|
||||||
// App logic to determine if all data is loaded
|
// App logic to determine if all data is loaded
|
||||||
// and disable the infinite scroll
|
// and disable the infinite scroll
|
||||||
if (this.data.length == 1000) {
|
if (this.data.length === 1000) {
|
||||||
ev.target.disabled = true;
|
ev.target.disabled = true;
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
@ -380,7 +380,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
// App logic to determine if all data is loaded
|
// App logic to determine if all data is loaded
|
||||||
// and disable the infinite scroll
|
// and disable the infinite scroll
|
||||||
if (items.value.length == 1000) {
|
if (items.value.length === 1000) {
|
||||||
ev.target.disabled = true;
|
ev.target.disabled = true;
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
|
@ -36,7 +36,7 @@ export class InfiniteScrollExample {
|
|||||||
|
|
||||||
// App logic to determine if all data is loaded
|
// App logic to determine if all data is loaded
|
||||||
// and disable the infinite scroll
|
// and disable the infinite scroll
|
||||||
if (data.length == 1000) {
|
if (data.length === 1000) {
|
||||||
event.target.disabled = true;
|
event.target.disabled = true;
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
|
@ -25,7 +25,7 @@ infiniteScroll.addEventListener('ionInfinite', function(event) {
|
|||||||
|
|
||||||
// App logic to determine if all data is loaded
|
// App logic to determine if all data is loaded
|
||||||
// and disable the infinite scroll
|
// and disable the infinite scroll
|
||||||
if (data.length == 1000) {
|
if (data.length === 1000) {
|
||||||
event.target.disabled = true;
|
event.target.disabled = true;
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
|
@ -37,7 +37,7 @@ const InfiniteScrollExample: React.FC = () => {
|
|||||||
pushData();
|
pushData();
|
||||||
console.log('Loaded data');
|
console.log('Loaded data');
|
||||||
ev.target.complete();
|
ev.target.complete();
|
||||||
if (data.length == 1000) {
|
if (data.length === 1000) {
|
||||||
setInfiniteDisabled(true);
|
setInfiniteDisabled(true);
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
|
@ -38,7 +38,7 @@ export class InfiniteScrollExample {
|
|||||||
|
|
||||||
// App logic to determine if all data is loaded
|
// App logic to determine if all data is loaded
|
||||||
// and disable the infinite scroll
|
// and disable the infinite scroll
|
||||||
if (this.data.length == 1000) {
|
if (this.data.length === 1000) {
|
||||||
ev.target.disabled = true;
|
ev.target.disabled = true;
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
|
@ -73,7 +73,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
// App logic to determine if all data is loaded
|
// App logic to determine if all data is loaded
|
||||||
// and disable the infinite scroll
|
// and disable the infinite scroll
|
||||||
if (items.value.length == 1000) {
|
if (items.value.length === 1000) {
|
||||||
ev.target.disabled = true;
|
ev.target.disabled = true;
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
|
Reference in New Issue
Block a user