Refactor #4231 - For ContextMenu

pull/4239/head
mertsincan 2023-08-02 15:00:28 +03:00
parent 4e5038cffd
commit b371f0e248
3 changed files with 6 additions and 2 deletions

View File

@ -75,6 +75,10 @@ export interface ContextMenuPassThroughOptions {
* @see {@link BaseComponent.ComponentHooks}
*/
hooks?: ComponentHooks;
/**
* Used to control Vue Transition API.
*/
transition?: any;
}
/**

View File

@ -1,6 +1,6 @@
<template>
<Portal :appendTo="appendTo">
<transition name="p-contextmenu" @enter="onEnter" @after-enter="onAfterEnter" @leave="onLeave" @after-leave="onAfterLeave">
<transition name="p-contextmenu" @enter="onEnter" @after-enter="onAfterEnter" @leave="onLeave" @after-leave="onAfterLeave" v-bind="ptm('transition')">
<div v-if="visible" :ref="containerRef" :class="cx('root')" v-bind="{ ...$attrs, ...ptm('root') }" data-pc-name="contextmenu">
<ContextMenuSub
:ref="listRef"

View File

@ -1,5 +1,5 @@
<template>
<transition name="p-contextmenusub" @enter="onEnter">
<transition name="p-contextmenusub" @enter="onEnter" v-bind="ptm('menu.transition')">
<ul v-if="root ? true : visible" ref="container" :tabindex="tabindex" v-bind="ptm('menu')">
<template v-for="(processedItem, index) of items" :key="getItemKey(processedItem)">
<li