Fixed #424 - Duplicate keys in TreeTable

pull/435/head
cagataycivici 2020-08-05 16:20:11 +03:00
parent 60673fc845
commit d7e7ec9652
2 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,6 @@
<template>
<tr :class="containerClass" @click="onClick" @keydown="onKeyDown" @touchend="onTouchEnd" :style="node.style" tabindex="0">
<td v-for="(col,i) of columns" :key="node.key + '_' + col.columnKey||col.field||i" :style="col.bodyStyle" :class="col.bodyClass">
<td v-for="(col,i) of columns" :key="col.columnKey||col.field||i" :style="col.bodyStyle" :class="col.bodyClass">
<button type="button" class="p-treetable-toggler p-link" @click="toggle" v-if="col.expander" :style="togglerStyle" tabindex="-1" v-ripple>
<i :class="togglerIcon"></i>
</button>

View File

@ -31,6 +31,7 @@ const TreeTableRowLoader = {
},
render(createElement, context) {
const root = createElement(TreeTableRow, {
key: context.props.node.key,
props: context.props,
on: {
'node-toggle': context.listeners['node-toggle'],
@ -51,6 +52,7 @@ const TreeTableRowLoader = {
childNodeProps.level = context.props.level + 1;
let childNodeElement = createElement(TreeTableRowLoader, {
key: childNode.key,
props: childNodeProps,
on: {
'node-toggle': context.listeners['node-toggle'],