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} * @see {@link BaseComponent.ComponentHooks}
*/ */
hooks?: ComponentHooks; hooks?: ComponentHooks;
/**
* Used to control Vue Transition API.
*/
transition?: any;
} }
/** /**

View File

@ -1,6 +1,6 @@
<template> <template>
<Portal :appendTo="appendTo"> <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"> <div v-if="visible" :ref="containerRef" :class="cx('root')" v-bind="{ ...$attrs, ...ptm('root') }" data-pc-name="contextmenu">
<ContextMenuSub <ContextMenuSub
:ref="listRef" :ref="listRef"

View File

@ -1,5 +1,5 @@
<template> <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')"> <ul v-if="root ? true : visible" ref="container" :tabindex="tabindex" v-bind="ptm('menu')">
<template v-for="(processedItem, index) of items" :key="getItemKey(processedItem)"> <template v-for="(processedItem, index) of items" :key="getItemKey(processedItem)">
<li <li