Skip to content

Commit af1a22a

Browse files
chouchoujichouchouji
andauthored
feat: add event to transitionend emit (#27)
Co-authored-by: chouchouji <[email protected]>
1 parent d105191 commit af1a22a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/content/1.getting-started/2.usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ import { SplitPanel } from '@directus/vue-split-panel';
125125

126126
### Emits
127127
::field-group
128-
::field{name="transitionend" type="() => void"}
128+
::field{name="transitionend" type="(event: TransitionEvent) => void"}
129129
The event triggered when the transition end.
130130
::
131131
::

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const props = withDefaults(defineProps<SplitPanelProps>(), {
2222
});
2323
2424
const emits = defineEmits<{
25-
transitionend: [];
25+
transitionend: [event: TransitionEvent];
2626
}>();
2727
2828
const panelEl = useTemplateRef('split-panel');
@@ -100,9 +100,9 @@ const collapsed = defineModel<boolean>('collapsed', { default: false });
100100
101101
const collapseTransitionState = ref<null | 'expanding' | 'collapsing'>(null);
102102
103-
const onTransitionEnd = () => {
103+
const onTransitionEnd = (event: TransitionEvent) => {
104104
collapseTransitionState.value = null;
105-
emits('transitionend');
105+
emits('transitionend', event);
106106
};
107107
108108
watch(collapsed, (newCollapsed) => {

0 commit comments

Comments
 (0)