【发布时间】:2018-10-05 13:58:51
【问题描述】:
下面是迭代列表时显示序列号的代码。 现在由于某些原因我无法对列表进行排序,列表将保持原样。 但我希望以相反的顺序打印序列号。如果数组的大小为 5,我需要 5 4 3 2 1。
<table class="table" border=1 width="650" style="word-wrap:break-word">
<tr>
<td colspan="6" class="heading">
<b>Corrigendum Document Details</b>
</td>
</tr>
<tr>
<th align="center" style="width:7.5%">Corr.No.</th>
<th align="center">Corrigendum Title</th>
<th align="center">Corrigendum Description</th>
<th align="center">Published Date</th>
<th align="center">Document Name</th>
<th align="center">Doc Size(in KB)</th>
</tr>
<tr v-for="(corrworkdoc,index) in corrWorkItemDocumentsAndCorrDetailList" i = index>
<td>{{index+1}}</td>
<td>{{corrworkdoc.corrigendumTitle}}</td>
<td>{{corrworkdoc.corrigendumDescription}}</td>
<td>{{corrworkdoc.publishedDate}}</td>
<td><a href="#" v-on:click="doDownload(corrworkdoc.fileName)" title="Download" style="color:blue;">{{corrworkdoc.fileName}}</a></td>
<td>{{corrworkdoc.docSize}}</td>
</tr>
</table>
如何以相反的顺序显示序列号。
【问题讨论】:
-
您只想要索引甚至内容?
-
你不能创建一个主数组的副本并反转它吗??
标签: javascript html arrays vue.js vuejs2