html - 反向迭代表(vue)
问题描述
我对这一切有点陌生,但我一直在尝试在 vue 中使用 slice().reverse(),但我一直在尝试的方式没有运气。我试图颠倒这张桌子的顺序。
<div v-if="page == 'Calls'" >
<h2 class="page-title">CALL MONITOR</h2>
<h4 v-if="Object.keys(calls).length == 0" style="text-align: center; font-size: 20px; font-weight: bold; margin-top: 20px;">No incoming calls.</h4>
<div style="margin: 0 auto; width: 100%; max-height: 90%; overflow-y: auto; margin-top: 20px;" v-if="Object.keys(calls).length > 0">
<table style="margin: 0 auto; width: 95%;">
<tr>
<th>#</th>
<th>Caller</th>
<th>Details</th>
<th>Date</th>
<th>Location</th>
<th>No. Attached</th>
<th>Actions</th>
</tr>
<tr v-for="(call, index) in calls" :key="index">
<td>{{index}}</td>
<td>{{call.source}}</td>
<td class="ellipsis"><span>{{call.details}}</span></td>
<td>{{call.time}}</td>
<td>{{call.location}}</td>
<td>{{attached(index)}}</td>
<td>
<i style="font-size: 1.5em;" class="fas fa-link" v-bind:class="getClass('clickable2')" v-if="current_call.id == null" v-on:click="AttachToCall(index)"></i>
<i style="font-size: 1.5em;" class="fas fa-unlink" v-bind:class="getClass('clickable2')" v-if="current_call.id == call.id" v-on:click="DetachFromCall(index)"></i>
<i style="font-size: 1.5em;" class="fas fa-map-marker-alt" v-bind:class="getClass('clickable2')" v-on:click="SetCallWaypoint(index)"></i>
<i style="font-size: 1.5em;" class="fas fa-info-circle" v-bind:class="getClass('clickable2')" v-on:click="ShowCallDetails(index)"></i>
<i style="font-size: 1.5em;" class="fas fa-edit" v-bind:class="getClass('clickable2')" v-if="current_call.id == call.id" v-on:click="EditCall(index)"></i>
<i style="font-size: 1.5em;" class="fas fa-trash" v-bind:class="getClass('clickable2')" v-on:click="DeleteCall(index)"></i>
</td>
</tr>
</table>
</div>
解决方案
推荐阅读
- azure - 为 Windows VM 调用 AzureRMVMRunCommand
- java - 如果对具体类进行更改,是否依赖接口而不是具体类会减少 Java 中的编译时间?
- python - Can't import module from subdirectory
- sql - SQL - 特定名称字段的响应时间计数范围
- java - What does the statement Object[][] data = new Object [][] mean?
- sql - Physical Pkey in Fact table
- github - 当我使用 git add 'sampleFile.txt' 时,Git 给了我'Permission Denied'
- java - 获取2个字符串的重复值并计算它们
- haskell - 在 Haskell 中执行断言
- html - 在 Blogger 中从正文中删除背景