mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Refactor #3965 - Added hooks
keyword to control all lifecycle methods to self/global PT options
This commit is contained in:
parent
d9baf298d5
commit
3442acade4
2 changed files with 32 additions and 2 deletions
|
@ -27,11 +27,11 @@ const BaseDirective = {
|
|||
},
|
||||
_hook: (directiveName, hookName, el, binding, vnode, prevVnode) => {
|
||||
const config = binding?.instance?.$primevue?.config;
|
||||
const globalHook = config?.pt?.directives?.[directiveName]?.hooks?.[hookName];
|
||||
const selfHook = binding?.value?.pt?.hooks?.[hookName];
|
||||
const globalHook = config?.pt?.directives?.[directiveName]?.hooks?.[hookName];
|
||||
|
||||
globalHook?.(el, binding, vnode, prevVnode);
|
||||
selfHook?.(el, binding, vnode, prevVnode);
|
||||
globalHook?.(el, binding, vnode, prevVnode);
|
||||
},
|
||||
_extend: (name, options = {}) => {
|
||||
const handleHook = (hook, el, binding, vnode, prevVnode) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue