Refactor #4211 - For Splitter
parent
b238d68d49
commit
587ed2a7ff
|
@ -20,6 +20,7 @@ export interface SplitterPassThroughMethodOptions {
|
|||
instance: any;
|
||||
props: SplitterProps;
|
||||
state: SplitterState;
|
||||
context: SplitterContext;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -93,6 +94,16 @@ export interface SplitterState {
|
|||
prevSize: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines options in Splitter component.
|
||||
*/
|
||||
export interface SplitterContext {
|
||||
/**
|
||||
* Current nested state of the component.
|
||||
*/
|
||||
nested?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines valid properties in Splitter component.
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div :class="cx('root')" :style="sx('root')" :data-p-resizing="false" v-bind="ptm('root')" data-pc-name="splitter">
|
||||
<div :class="cx('root')" :style="sx('root')" :data-p-resizing="false" v-bind="ptm('root', getPTOptions())" data-pc-name="splitter">
|
||||
<template v-for="(panel, i) of panels" :key="i">
|
||||
<component :is="panel" tabindex="-1"></component>
|
||||
<div
|
||||
|
@ -79,6 +79,13 @@ export default {
|
|||
this.unbindMouseListeners();
|
||||
},
|
||||
methods: {
|
||||
getPTOptions() {
|
||||
return {
|
||||
context: {
|
||||
nested: DomHandler.getAttribute(this.$parentInstance?.$el, 'data-pc-name') === 'splitterpanel'
|
||||
}
|
||||
};
|
||||
},
|
||||
isSplitterPanel(child) {
|
||||
return child.type.name === 'SplitterPanel';
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue