diff --git a/src/components/TreeTable/eval.js b/src/components/TreeTable/eval.js index dfaac808..d9b89e1c 100644 --- a/src/components/TreeTable/eval.js +++ b/src/components/TreeTable/eval.js @@ -4,11 +4,11 @@ */ 'use strict' import Vue from 'vue' -export default function treeToArray(data, expandedAll, parent = null, level = null) { +export default function treeToArray(data, expandAll, parent = null, level = null) { let tmp = [] Array.from(data).forEach(function(record) { if (record._expanded === undefined) { - Vue.set(record, '_expanded', expandedAll) + Vue.set(record, '_expanded', expandAll) } let _level = 1 if (level !== undefined && level !== null) { @@ -21,7 +21,7 @@ export default function treeToArray(data, expandedAll, parent = null, level = nu } tmp.push(record) if (record.children && record.children.length > 0) { - const children = treeToArray(record.children, expandedAll, record, _level) + const children = treeToArray(record.children, expandAll, record, _level) tmp = tmp.concat(children) } }) diff --git a/src/components/TreeTable/index.vue b/src/components/TreeTable/index.vue index 4ec22447..c33fc886 100644 --- a/src/components/TreeTable/index.vue +++ b/src/components/TreeTable/index.vue @@ -58,7 +58,7 @@ export default { tmp = this.data } const func = this.evalFunc || treeToArray - const args = this.evalArgs ? Array.concat([tmp], this.evalArgs) : [tmp, this.expandAll] + const args = this.evalArgs ? Array.concat([tmp, this.expandAll], this.evalArgs) : [tmp, this.expandAll] return func.apply(null, args) } }, @@ -66,7 +66,7 @@ export default { showRow: function(row) { const show = (row.row.parent ? (row.row.parent._expanded && row.row.parent._show) : true) row.row._show = show - return show ? '' : 'display:none;' + return show ? 'animation:treeTableShow 1s;-webkit-animation:treeTableShow 1s;' : 'display:none;' }, // 切换下级是否展开 toggleExpanded: function(trIndex) { @@ -80,6 +80,16 @@ export default { } } +