Commit 9aa37cee authored by 何虹's avatar 何虹 💬

优化表格健壮性

parent 9c98fbfb
......@@ -102,7 +102,10 @@
:sortable="columnItem.isSort?'custom':false"
>
<template v-slot:header>
<span v-if="columnItem.isRequired" :class="{'is-isRequired': columnItem.isRequired}">
<span
v-if="columnItem.isRequired"
:class="{'is-isRequired': columnItem.isRequired}"
>
*
</span>
<span>{{ columnItem.label }}</span>
......@@ -237,7 +240,10 @@
:sortable="column.isSort"
>
<template v-slot:header>
<span v-if="column.isRequired" :class="{'is-isRequired': column.isRequired}">
<span
v-if="column.isRequired"
:class="{'is-isRequired': column.isRequired}"
>
*
</span>
<span>{{ column.label }}</span>
......@@ -396,7 +402,7 @@ export default {
},
// 第一行数据
firstRow() {
return (this.data.length && this.data[0]) || {}
return (this.data && this.data.length && this.data[0]) || {}
},
// 表格真实显示数据
tableData() {
......@@ -1083,7 +1089,7 @@ export default {
td {
height: 35px !important;
}
.is-isRequired{
.is-isRequired {
color: red;
}
</style>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment