bug: ion-infinite-scroll when loadmore data error. ionInfinite will be trigger many many times.
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- typescript
- Ambito
- frontend
Direzione di ricerca
Inizia con la riproduzione Vue/TypeScript fornita, concentrandoti sull’handler ionInfinite e sulla sua chiamata a loadNextPage quando la richiesta simulata della pagina 2 viene rifiutata. Verifica che l’evento infinite-scroll non si ripeta dopo l’errore di caricamento di altri elementi; l’issue non indica alcun file sorgente del repository né alcun test da eseguire.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v8.x
Current Behavior
trigger many many times
Expected Behavior
do not trigger
Steps to Reproduce
pull up loadmore
Code Reproduction URL
1
Ionic Info
1
Additional Information
首页 {{ item.name }} <script setup lang="ts"> import { IonPage, IonList, IonButton, IonItem, IonHeader, IonTitle, IonToolbar, IonRefresher, IonContent, IonRefresherContent, RefresherCustomEvent, IonInfiniteScroll, IonInfiniteScrollContent, InfiniteScrollCustomEvent } from "@ionic/vue" import LoadStatus from '@/components/load-status/load-status.vue'; import {useLoadStatus} from "@/components/load-status/useLoadStatus" import {chevronDownCircleOutline} from "ionicons/icons" // 模拟请求数据的接口客户端 const loadImpl = async (endpoint: string, p: { page: number; size: number }) => { // 模拟网络请求延迟 await new Promise(resolve => setTimeout(resolve, 1000)); // throw new Error("接口请求失败"); // return [] console.log(`请求接口 ${endpoint},页码: ${p.page}, 每页大小: ${p.size}`); if (p.page >= 2) { throw new Error(`接口请求失败=${p.page}`); } // 模拟分页数据 const totalItems = 45; // 假设总共有45条数据 const start = (p.page - 1) * p.size const end = start + p.size const items = Array.from({length: totalItems}, (_, i) => ({id: i + 1, name: `数据项 ${i + 1}`})); return items.slice(start, end); // const start = (page - 1) * size; // const start = (curPage.value - 1) * pageSize; // const end = start + pageSize; // const items = Array.from({length: totalItems}, (_, i) => ({id: i + 1, name: `数据项 ${i + 1}`})); // return items.slice(start, end); }; // Dashboard 数据请求配置 const {data, status, error, hasMore, hasData, isLoadingMore, refresh, loadNextPage} = useLoadStatus({ fetcher: async (curPage, pageSize) => { // 支持分页 const res = await loadImpl('/dashboard', {page: curPage!, size: pageSize!}); return res; }, pageSize: 20, autoFetch: true }); const handleRefresh = (event: RefresherCustomEvent) => { refresh().then(() => { event.target.complete(); }); }; const ionInfinite = (event: InfiniteScrollCustomEvent) => { // generateItems(); // setTimeout(() => event.target.complete(), 500); console.log("触发上拉加载更多"); loadNextPage().then(() => { console.log("加载下一页完成"); event.target.complete(); // setTimeout(() => { // event.target.disabled = false // }, 2000) }) }; </script>- Lingua principale
- TypeScript
- Stelle
- 52.8k
- Fork
- 13.3k
- Merge medio
- 3g 1h
- PR unite (30g)
- 86
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ionic-team/ionic-framework
-
bug: input-otp, backspace in an empty box only moves focus instead of clearing the previous boxForse già presa @sarankumar1325 l’ha presa 23 giorni fa. Apertapackage: core type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
ionic-team/ionic-framework#31639 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug: vue swipe cancellation throws when the previous page is missingForse già presa @dandoingdev l’ha presa 46 giorni fa. Apertapackage: vue type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ionic-team/ionic-framework#31514 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug: ion-searchbar input is always labelled "search text"; aria-label on the host is not forwardedForse già presa @HappyKnuckles l’ha presa 41 giorni fa. Apertaa11y package: core type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
ionic-team/ionic-framework#31492 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug: IonTabs throws when a Fragment contains one IonRouterOutletForse già presa @Benziza l’ha presa 82 giorni fa. Apertapackage: react type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ionic-team/ionic-framework#31410 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug: angular swipe-back gesture crashes in StackController.startBackTransition when the stack is popped before the gesture is capturedForse già presa @officialasishkumar l’ha presa 9 giorni fa. Apertapackage: angular type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
ionic-team/ionic-framework#31291 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ionic-team/ionic-framework
Issue simili
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
lingdojo/kana-dojo#34223 · 1 commento · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
bug status: needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
mastra-ai/mastra#30587 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area:web p2 product:business triage:active type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
cuadrao-ai/argus#2228 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
embedpdf/embed-pdf-viewer#1098 ·
I maintainer di solito rispondono entro 1 giorno
-
.Needs Triage .Team/Metabot Priority:P3 Type:Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
metabase/metabase#87252 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno