Closed
Description
Vue version
3.5.0
Link to minimal reproduction
Steps to reproduce
The error occurs immediately.
P.S.: This bug can be triggered if the total number of updates to a reactive object within a v-for
exceeds 100.The following code patterns will all trigger the error.
<script setup>
import { ref, onMounted } from 'vue';
const options = ref([])
onMounted(()=>{
options.value = Array.from({ length: 34 }, () => ({}))
})
</script>
<template>
<div v-for="(item, i) in options" :key="i">
{{ item.a ? item.a : item.a = i }}
{{ item.b ? item.b : item.b = i }}
{{ item.c ? item.c : item.c = i }}
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue';
const options = ref([])
onMounted(()=>{
options.value = Array.from({ length: 21 }, () => ({}))
})
</script>
<template>
<div v-for="(item, i) in options" :key="i">
{{ item.a ? item.a : item.a = i }}
{{ item.b ? item.b : item.b = i }}
{{ item.c ? item.c : item.c = i }}
{{ item.d ? item.d : item.d = i }}
{{ item.e ? item.e : item.e = i }}
</div>
</template>
What is expected?
This issue does not occur in version 3.4.38. The goal is to prevent the error from occurring again.
What is actually happening?
It’s not confirmed, but I suspect there’s an error in the flushJobs
function of runtime-core
related to the calculation of count
.
System Info
No response
Any additional comments?
In my local development environment, this error causes certain components that work in 3.4.38 (such as those using options in a select) to become unusable, leading to rendering issues.