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

优化表格健壮性

parent 9c98fbfb
...@@ -102,7 +102,10 @@ ...@@ -102,7 +102,10 @@
:sortable="columnItem.isSort?'custom':false" :sortable="columnItem.isSort?'custom':false"
> >
<template v-slot:header> <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>
<span>{{ columnItem.label }}</span> <span>{{ columnItem.label }}</span>
...@@ -237,7 +240,10 @@ ...@@ -237,7 +240,10 @@
:sortable="column.isSort" :sortable="column.isSort"
> >
<template v-slot:header> <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>
<span>{{ column.label }}</span> <span>{{ column.label }}</span>
...@@ -396,7 +402,7 @@ export default { ...@@ -396,7 +402,7 @@ export default {
}, },
// 第一行数据 // 第一行数据
firstRow() { firstRow() {
return (this.data.length && this.data[0]) || {} return (this.data && this.data.length && this.data[0]) || {}
}, },
// 表格真实显示数据 // 表格真实显示数据
tableData() { tableData() {
...@@ -1083,7 +1089,7 @@ export default { ...@@ -1083,7 +1089,7 @@ export default {
td { td {
height: 35px !important; height: 35px !important;
} }
.is-isRequired{ .is-isRequired {
color: red; color: red;
} }
</style> </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