From 5e681b594577054944a0bf8fc464bf50bf8478e6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E7=99=BD=E9=9B=BE=E4=B8=89=E8=AF=AD?= <32354856+baiwusanyu-c@users.noreply.github.com> Date: Wed, 13 Dec 2023 15:01:07 +0800 Subject: [PATCH] feat(compiler-vapor): functional custom directive support updated hooks (#58) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Co-authored-by: 三咲智子 Kevin Deng --- packages/runtime-vapor/src/directive.ts | 4 ++-- playground/src/directive.vue | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/packages/runtime-vapor/src/directive.ts b/packages/runtime-vapor/src/directive.ts index f255153fdc..3906eb7234 100644 --- a/packages/runtime-vapor/src/directive.ts +++ b/packages/runtime-vapor/src/directive.ts @@ -76,9 +76,9 @@ export function withDirectives( let [dir, source, arg, modifiers] = directive if (!dir) continue if (isFunction(dir)) { - // TODO function directive dir = { - created: dir, + mounted: dir, + updated: dir, } satisfies ObjectDirective } diff --git a/playground/src/directive.vue b/playground/src/directive.vue index 1b92026060..81d4a3e532 100644 --- a/playground/src/directive.vue +++ b/playground/src/directive.vue @@ -1,7 +1,7 @@ -- 2.47.2