|
@@ -1,4 +1,5 @@
|
|
|
<template>
|
|
|
+<!-- 使用tree-props 防止递归 -->
|
|
|
<el-table
|
|
|
ref="multipleTable"
|
|
|
class="expandTable"
|
|
@@ -6,6 +7,8 @@
|
|
|
style="width: 100%;z-index:1"
|
|
|
:row-key="getRowKeys"
|
|
|
:expand-row-keys="expands"
|
|
|
+ :tree-props="{children:'children1', hasChildren: 'hasChildren1'}"
|
|
|
+ @expand-change='expandChange'
|
|
|
>
|
|
|
<el-table-column type="expand">
|
|
|
<template slot-scope="props">
|
|
@@ -70,6 +73,12 @@ export default {
|
|
|
this.$nextTick(() => this.doSelect())
|
|
|
},
|
|
|
methods: {
|
|
|
+ expandChange(row,expandedRows){
|
|
|
+ console.log(row,expandedRows)
|
|
|
+ if(expandedRows){
|
|
|
+ this.$nextTick(() => this.doSelect())
|
|
|
+ }
|
|
|
+ },
|
|
|
initExpand() {
|
|
|
this.dataList.forEach(i => {
|
|
|
if(i.children.some(c => c.isSatisfy == false)) this.expands.push(i.id)
|