Fixed #1914 - Error while dynamic remove SplitterPanel component

pull/1934/head
Tuğçe Küçükoğlu 2021-12-21 13:50:34 +03:00
parent 517a0d7602
commit 60ece4fdcc
1 changed files with 5 additions and 5 deletions

View File

@ -1,14 +1,14 @@
<template> <template>
<div :class="containerClass"> <div :class="containerClass">
<template v-for="(panel,i) of panels" :key="i" class="p-splitter-panel"> <template v-for="(panel,i) of panels" :key="i" class="p-splitter-panel">
<component :is="panel"></component> <component :is="panel"></component>
<div class="p-splitter-gutter" v-if="i !== (panels.length -1)" :style="gutterStyle" <div class="p-splitter-gutter" v-if="i !== (panels.length -1)" :style="gutterStyle"
@mousedown="onGutterMouseDown($event, i)" @mousedown="onGutterMouseDown($event, i)"
@touchstart="onGutterTouchStart($event, i)" @touchstart="onGutterTouchStart($event, i)"
@touchmove="onGutterTouchMove($event, i)" @touchmove="onGutterTouchMove($event, i)"
@touchend="onGutterTouchEnd($event, i)"> @touchend="onGutterTouchEnd($event, i)">
<div class="p-splitter-gutter-handle"></div> <div class="p-splitter-gutter-handle"></div>
</div> </div>
</template> </template>
</div> </div>
</template> </template>
@ -229,7 +229,7 @@ export default {
if (this.isSplitterPanel(child)) { if (this.isSplitterPanel(child)) {
panels.push(child); panels.push(child);
} }
else if (child.children.length > 0) { else if (child.children.length instanceof Array) {
child.children.forEach(nestedChild => { child.children.forEach(nestedChild => {
if (this.isSplitterPanel(nestedChild)) { if (this.isSplitterPanel(nestedChild)) {
panels.push(nestedChild) panels.push(nestedChild)