Skip to content

Commit

Permalink
refactor: Pass provided slots instead remapping all for initial render
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasenkoo committed Aug 28, 2023
1 parent 42cb319 commit 9625db2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/VueDatePicker/composables/position.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { OpenPosition } from '@/interfaces';

import { unrefElement } from '@/utils/util';
import { MenuPlacement } from '@/constants';
import { mapSlots } from '@/composables/slots';

import type { Component, ComponentPublicInstance, ComputedRef, Ref, Slots } from 'vue';
import type { ComponentRef, InlineOptions, VueEmit } from '@/interfaces';
Expand All @@ -24,7 +23,6 @@ export const usePosition = (
) => {
const menuRect = ref<DOMRect>({} as DOMRect);
const xCorrect = ref(false);
const slotList = mapSlots(slots, 'all', props.presetDates);

const menuStyle = ref<Partial<CSSStyleDeclaration>>({
top: '0',
Expand Down Expand Up @@ -252,7 +250,7 @@ export const usePosition = (
shadow: true,
style: { opacity: 0, position: 'absolute', ...pos },
},
Object.fromEntries(slotList.map((slot) => [slot, slots[slot]])),
Object.fromEntries(Object.keys(slots).map((slot) => [slot, slots[slot]])),
);

render(el, renderContainer);
Expand Down

0 comments on commit 9625db2

Please sign in to comment.