mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Refactor #3965 - Refactor on OrganizationChart
This commit is contained in:
parent
a4529e5be0
commit
b1eb42aca5
2 changed files with 6 additions and 24 deletions
|
@ -3,7 +3,7 @@
|
|||
<tbody v-bind="ptm('body')">
|
||||
<tr v-if="node" v-bind="ptm('row')">
|
||||
<td :colspan="colspan" v-bind="ptm('cell')">
|
||||
<div :class="cx('node')" @click="onNodeClick" v-bind="getPTOptions('node')">
|
||||
<div :class="[cx('node'), node.styleClass]" @click="onNodeClick" v-bind="getPTOptions('node')">
|
||||
<component :is="templates[node.type] || templates['default']" :node="node" />
|
||||
<a v-if="toggleable" tabindex="0" :class="cx('nodeToggler')" @click="toggleNode" @keydown="onKeydown" v-bind="getPTOptions('nodeToggler')">
|
||||
<component v-if="templates.togglericon" :is="templates.togglericon" :expanded="expanded" class="p-node-toggler-icon" />
|
||||
|
@ -25,26 +25,8 @@
|
|||
</template>
|
||||
<template v-if="node.children && node.children.length > 1">
|
||||
<template v-for="(child, i) of node.children" :key="child.key">
|
||||
<td
|
||||
:class="
|
||||
cx('lineLeft', {
|
||||
i
|
||||
})
|
||||
"
|
||||
v-bind="getNodeOptions(!(i === 0), 'lineLeft')"
|
||||
>
|
||||
|
||||
</td>
|
||||
<td
|
||||
:class="
|
||||
cx('lineRight', {
|
||||
i
|
||||
})
|
||||
"
|
||||
v-bind="getNodeOptions(!(i === node.children.length - 1), 'lineRight')"
|
||||
>
|
||||
|
||||
</td>
|
||||
<td :class="cx('lineLeft', { index: i })" v-bind="getNodeOptions(!(i === 0), 'lineLeft')"> </td>
|
||||
<td :class="cx('lineRight', { index: i })" v-bind="getNodeOptions(!(i === node.children.length - 1), 'lineRight')"> </td>
|
||||
</template>
|
||||
</template>
|
||||
</tr>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue