Skip to content

Commit 3f0d466

Browse files
committed
feat: Add the "transitionend" event to enhance the interactivity of the component.
1 parent 8576090 commit 3f0d466

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/vue-split-panel/src/SplitPanel.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ const props = withDefaults(defineProps<SplitPanelProps>(), {
2121
snapThreshold: 12,
2222
});
2323
24+
const emits = defineEmits<{
25+
(e: 'transitionend'): void;
26+
}>();
27+
2428
const panelEl = useTemplateRef('split-panel');
2529
const dividerEl = useTemplateRef('divider');
2630
@@ -96,7 +100,10 @@ const collapsed = defineModel<boolean>('collapsed', { default: false });
96100
97101
const collapseTransitionState = ref<null | 'expanding' | 'collapsing'>(null);
98102
99-
const onTransitionEnd = () => collapseTransitionState.value = null;
103+
const onTransitionEnd = () => {
104+
collapseTransitionState.value = null;
105+
emits('transitionend');
106+
};
100107
101108
watch(collapsed, (newCollapsed) => {
102109
if (newCollapsed === true) {

0 commit comments

Comments
 (0)