Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Document props and events
Browse files Browse the repository at this point in the history
  • Loading branch information
sarayourfriend committed Nov 11, 2021
1 parent fde92a4 commit 04f4e3c
Showing 1 changed file with 55 additions and 1 deletion.
56 changes: 55 additions & 1 deletion src/components/VPopover/VPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,72 @@ import {
export default defineComponent({
name: 'VPopover',
components: { VPopoverContent },
/**
* NB: Most of these technically default to `undefined` so that the underlying `VPopoverContent`
* default for each of them can take over.
*/
props: {
/**
* Whether the popover should hide when the <kbd>Escape</kbd> key is pressed.
*
* @default true
*/
hideOnEsc: { type: Boolean, default: undefined },
/**
* Whether the popover should hide when a click happens outside the popover content,
* excluding the trigger. When the trigger is clicked and the popover is open, nothing
* will happen.
*
* @default true
*/
hideOnClickOutside: { type: Boolean, default: undefined },
/**
* Whether the popover content should automatically receive focus when the popover
* opens.
*
* @default true
*/
autoFocusOnShow: { type: Boolean, default: undefined },
/**
* Whether the trigger should automatically receive focus when the popover closes.
*
* @default true
*/
autoFocusOnHide: { type: Boolean, default: undefined },
/**
* The placement of the popover relative to the trigger. Should be one of the options
* for `placement` passed to popper.js.
*
* @see https://popper.js.org/docs/v2/constructors/#options
*
* @default 'bottom'
*/
placement: {
type: /** @type {import('@nuxtjs/composition-api').PropType<import('@popperjs/core').Placement>} */ (String),
},
/**
* The label of the popover content. Must be provided if `labelledBy` is empty.
*
* @default undefined
*/
label: { type: String },
/**
* The id of the element labelling the popover content. Must be provided if `label` is empty.
*
* @default undefined
*/
labelledBy: { type: String },
},
emits: ['open', 'close'],
emits: [
/**
* Fires when the popover opens, regardless of reason. There are no extra parameters.
*/
'open',
/**
* Fires when the popover closes, regardless of reason. There are no extra parameters.
*/
'close',
],
setup(_, { emit }) {
const visibleRef = ref(false)
/** @type {import('@nuxtjs/composition-api').Ref<HTMLElement | undefined>} */
Expand Down

0 comments on commit 04f4e3c

Please sign in to comment.