<el-table-column :key="Math.random()" v-if="[0,1,2,3,4].includes(info.index)" align="center" type="selection" width="60" :selectable="checkboxSelect" disabled />
<el-table-column
v-for="(col,index) in gridDataOne"
:key="index"
:prop="col.prop"
:label="col.label"
:width="col.width"
align="center"
:show-overflow-tooltip="true"
/>
<el-table-column v-if="[0,1,2,3,4].includes(info.index)" class="version-td" label="注册 ID" prop="stationNum" width="auto" />
<el-table-column v-if="[4].includes(info.index)" class="version-td" label="物联网卡" prop="simCardId" width="auto" :show-overflow-tooltip="true" />
<el-table-column v-if="[6].includes(info.index)" class="version-td" label="区域类型" width="auto" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.customConfigData ? scope.row.customConfigData.deviceType : '' }}
</template>
</el-table-column>
当前 info.index === 6 这是一个代码段,我如果不加:key="Math.random()"那么第一个多选就会显示,不受 if 控制,如果直接删掉,后面内容就会顶到前面但是标题栏还会有个多选框显示,加了:key="Math.random()"都正常了,想了解下原因。。
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.