VueJs | Laravel | Vue.js函数在循环内不起作用

时间:2018-11-25 17:37:51

标签: laravel

我有一个错误:

You may have an infinite update loop in a component render function.

此功能:

         getID: function(invoicesnvs) {
           this.idd=invoicesnvs.id;
            },

在此循环函数中不起作用:

        getRinvoicesnv: function () {
            axios.get('/getrinvoicesnv')
            .then(response => {
                console.log(response.data);
                this.invoicesnvs = response.data;
            })
            .catch(error => {
                console.log('errors: ', error);
            })
             },
created: function () {
  this.getRinvoicesnv()
  this.getTemplate()
}

在刀片中:

<tr v-for="invoicesnv in invoicesnvs">   
 <a type="button" @click="getID(invoicesnv)" ></a>
</tr>

有什么帮助吗?谢谢 ! 请注意,该功能仅在执行刀片中存在的另一个功能后才能工作。

0 个答案:

没有答案