如何打破 vuejs 中的 v-for 循环 [英] How to break a v-for loop in vuejs

查看:38
本文介绍了如何打破 vuejs 中的 v-for 循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个我在下面提到的代码段.我用过 vuejs 和 vuetifyjs.

I have a code segment that i have mentioned below. I have used vuejs with vuetifyjs.

 <v-data-table v-bind:headers="headers" v-bind:items="uniqueSubjects">
                            <template slot="items" slot-scope="props">
                                <td class="text-xs-center">{{ props.index+1 }}</td>
                                <td class="text-xs-center">{{ month[new Date(props.item.daily_date).getMonth()] }},{{ props.item.student_id }}</td>
                                <td class="text-xs-center">{{ props.item.subjects.subject_name }}{{ props.item.subjects.id }}</td>
                                <template v-for="n in 31">  
                                    <template v-for="(mark,index) in resultsList">
                                        <template v-if="new Date(mark.daily_date).getDate() == n && mark.subject_id == props.item.subject_id && mark.student_id == props.item.student_id">
                                            <td class="text-xs-center">
                                                {{ mark.daily_marks }}
                                            </td>
                                        </template>
                                        <template v-else-if="index>=resultsList.length-1">
                                            <td class="text-xs-center">-</td>
                                        </template>
                                    </template>
                                </template>
                            </template>
                            <template slot="pageText" slot-scope="{ pageStart, pageStop }">
                                From {{ pageStart }} to {{ pageStop }}
                            </template>
                        </v-data-table>

我想在内部 v-if 条件为真时中断我的