|
@@ -101,7 +101,7 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<el-button
|
|
|
- v-if="detail.use_data.length > 3"
|
|
|
+ v-if="detail.use_data && detail.use_data.length > 3"
|
|
|
style="width: 100%; border-top: none"
|
|
|
@click="showAllData"
|
|
|
>
|
|
@@ -164,9 +164,16 @@
|
|
|
}),
|
|
|
// 计算属性,根据showAll状态切换显示的数据
|
|
|
filteredData() {
|
|
|
- return this.showAll
|
|
|
- ? this.detail.use_data
|
|
|
- : this.detail.use_data.slice(0, 3)
|
|
|
+ if (
|
|
|
+ !this.showAll &&
|
|
|
+ this.detail.use_data &&
|
|
|
+ this.detail.use_data.length > 3
|
|
|
+ ) {
|
|
|
+ return this.detail.use_data.slice(0, 3)
|
|
|
+ } else {
|
|
|
+ // 否则返回完整的数据
|
|
|
+ return this.detail.use_data
|
|
|
+ }
|
|
|
},
|
|
|
showButtonText() {
|
|
|
return this.showAll ? '收起' : '更多'
|