site-panzai/node_modules/nuxt/dist/app/components/vfor.js

11 lines
480 B
JavaScript
Raw Permalink Normal View History

2026-11-13 13:57:04 +01:00
export const MAX_VFOR_LENGTH = 1e4;
export function vforBound(source) {
if (typeof source !== "number" || source <= MAX_VFOR_LENGTH) {
return source;
}
if (import.meta.dev) {
console.warn(`A v-for in a server component asked for ${source} iterations; only the first ${MAX_VFOR_LENGTH} were rendered. Island props come from the request, so the count is capped. Paginate the data, or clamp the value before passing it to the island.`);
}
return MAX_VFOR_LENGTH;
}