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

优化表格健壮性

parent 9c98fbfb
......@@ -101,12 +101,15 @@
:min-width="columnItem.width||80"
:sortable="columnItem.isSort?'custom':false"
>
<template v-slot:header>
<span v-if="columnItem.isRequired" :class="{'is-isRequired': columnItem.isRequired}">
*
</span>
<span>{{ columnItem.label }}</span>
</template>
<template v-slot:header>
<span
v-if="columnItem.isRequired"
:class="{'is-isRequired': columnItem.isRequired}"
>
*
</span>
<span>{{ columnItem.label }}</span>
</template>
<template slot-scope="scope">
<i
v-if="columnItem.type==='checkBox'"
......@@ -236,12 +239,15 @@
:min-width="column.width||80"
:sortable="column.isSort"
>
<template v-slot:header>
<span v-if="column.isRequired" :class="{'is-isRequired': column.isRequired}">
*
</span>
<span>{{ column.label }}</span>
</template>
<template v-slot:header>
<span
v-if="column.isRequired"
:class="{'is-isRequired': column.isRequired}"
>
*
</span>
<span>{{ column.label }}</span>
</template>
<template slot-scope="scope">
<i
v-if="column.type==='checkBox'"
......@@ -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