Home  >  Q&A  >  body text

May be wary of potential infinite update loops in Vue component render functions during iteration

I have an array with 4 objects and I render it as follows

<div v-for="item in cant_objetivos_tipo">
        {{ item.__data__.nombre_monitor_tipo + ' : ' + item.__data__.cantidad_objetivos }}
</div>

Then when I try to fill another array with data like below

<div v-for="item in cant_objetivos_tipo">
        {{ datapie.push(item.__data__.nombre_monitor_tipo + ' : ' + item.__data__.cantidad_objetivos) }}
</div

I encountered an infinite loop error

datapie[] declared before

<script>
    import axios from 'axios'
    
    export default {
        data() {
            return {
                cant_objetivos_tipo: [],
                datapie: [],
          }
        },...

Hope you can help me, thank you very much

P粉066725148P粉066725148204 days ago412

reply all(1)I'll reply

  • P粉165522886

    P粉1655228862024-03-29 00:24:30