File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -176,14 +176,19 @@ export default {
176176 this .$_unusedViews = new Map ()
177177 this .$_scrollDirty = false
178178
179- if (this .$isServer ) {
179+ // In SSR mode, we also prerender the same number of item for the first render
180+ // to avoir mismatch between server and client templates
181+ if (this .prerender ) {
182+ this .$_prerender = true
180183 this .updateVisibleItems (false )
181184 }
182185 },
183186
184187 mounted () {
185188 this .applyPageMode ()
186189 this .$nextTick (() => {
190+ // In SSR mode, render the real number of visible items
191+ this .$_prerender = false
187192 this .updateVisibleItems (true )
188193 this .ready = true
189194 })
@@ -280,7 +285,7 @@ export default {
280285
281286 if (! count) {
282287 startIndex = endIndex = totalSize = 0
283- } else if (this .$isServer ) {
288+ } else if (this .$_prerender ) {
284289 startIndex = 0
285290 endIndex = this .prerender
286291 totalSize = null
You can’t perform that action at this time.
0 commit comments