Skip to content

Commit

Permalink
fix: directives shorthand normalize error (fix vuejs#12743)
Browse files Browse the repository at this point in the history
  • Loading branch information
JuniorTour committed Aug 16, 2022
1 parent f0057b1 commit cc1a621
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/core/vdom/modules/directives.ts
Expand Up @@ -103,7 +103,15 @@ function normalizeDirectives(
}
res[getRawDirName(dir)] = dir
if (vm._setupState && vm._setupState.__sfc) {
dir.def = dir.def || resolveAsset(vm, '_setupState', 'v-' + dir.name)
const setupDef = dir.def || resolveAsset(vm, '_setupState', 'v-' + dir.name)
if (typeof setupDef === 'function') {
dir.def = {
bind: setupDef,
update: setupDef,
}
} else {
dir.def = setupDef
}
}
dir.def = dir.def || resolveAsset(vm.$options, 'directives', dir.name, true)
}
Expand Down

0 comments on commit cc1a621

Please sign in to comment.