Fixed #424 - Duplicate keys in TreeTable
parent
60673fc845
commit
d7e7ec9652
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<tr :class="containerClass" @click="onClick" @keydown="onKeyDown" @touchend="onTouchEnd" :style="node.style" tabindex="0">
|
<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>
|
<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>
|
<i :class="togglerIcon"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -31,6 +31,7 @@ const TreeTableRowLoader = {
|
||||||
},
|
},
|
||||||
render(createElement, context) {
|
render(createElement, context) {
|
||||||
const root = createElement(TreeTableRow, {
|
const root = createElement(TreeTableRow, {
|
||||||
|
key: context.props.node.key,
|
||||||
props: context.props,
|
props: context.props,
|
||||||
on: {
|
on: {
|
||||||
'node-toggle': context.listeners['node-toggle'],
|
'node-toggle': context.listeners['node-toggle'],
|
||||||
|
@ -51,6 +52,7 @@ const TreeTableRowLoader = {
|
||||||
childNodeProps.level = context.props.level + 1;
|
childNodeProps.level = context.props.level + 1;
|
||||||
|
|
||||||
let childNodeElement = createElement(TreeTableRowLoader, {
|
let childNodeElement = createElement(TreeTableRowLoader, {
|
||||||
|
key: childNode.key,
|
||||||
props: childNodeProps,
|
props: childNodeProps,
|
||||||
on: {
|
on: {
|
||||||
'node-toggle': context.listeners['node-toggle'],
|
'node-toggle': context.listeners['node-toggle'],
|
||||||
|
|
Loading…
Reference in New Issue