feature: update popover component

This commit is contained in:
Sagi 2022-09-27 20:30:45 +08:00
parent 976fac55e1
commit c409b355fe
3 changed files with 101 additions and 98 deletions

View File

@ -18,7 +18,7 @@ export default defineComponent({
<>
<div class="popover-arrow arrow"></div>
{shouldShowTitle.value && <h3 class="popover-title popover-header">{props.title}</h3>}
<div class={popoverContainerClass.value}></div>
<div class={popoverContainerClass.value}>{context.slots.default && context.slots?.default()}</div>
</>
);
};

View File

@ -1,7 +1,10 @@
import { ExtractPropTypes } from 'vue';
import { ExtractPropTypes, PropType } from 'vue';
export type PopoverPosition = 'top' | 'bottom' | 'left' | 'right' | 'auto';
export const popoverProps = {
title: { type: String },
position: { type: String as PropType<PopoverPosition>, default: 'top' },
};
export type PopoverProps = ExtractPropTypes<typeof popoverProps>;