2022-09-06 12:03:37 +00:00
|
|
|
<template>
|
|
|
|
<div ref="container" :class="containerClass">
|
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: 'SplitterPanel',
|
|
|
|
props: {
|
|
|
|
size: {
|
|
|
|
type: Number,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
minSize: {
|
|
|
|
type: Number,
|
|
|
|
default: null
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
containerClass() {
|
2022-09-14 11:26:01 +00:00
|
|
|
return ['p-splitter-panel', { 'p-splitter-panel-nested': this.isNested }];
|
2022-09-06 12:03:37 +00:00
|
|
|
},
|
|
|
|
isNested() {
|
2022-09-14 11:26:01 +00:00
|
|
|
return this.$slots.default().some((child) => {
|
2022-09-06 12:03:37 +00:00
|
|
|
return child.type.name === 'Splitter';
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
2022-09-14 11:26:01 +00:00
|
|
|
};
|
2022-09-06 12:03:37 +00:00
|
|
|
</script>
|