]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
feat(sfc): change `<script setup>` directive resolution to require v prefix
authorEvan You <yyx990803@gmail.com>
Mon, 28 Jun 2021 21:35:28 +0000 (17:35 -0400)
committerEvan You <yyx990803@gmail.com>
Mon, 28 Jun 2021 21:35:31 +0000 (17:35 -0400)
close #3543

packages/compiler-core/src/transforms/transformElement.ts

index 36396c5d7d1a2770928d95bece432c717c8633a6..cbf1b474bfb3eec3e26f4d6a6034f9526490fb5c 100644 (file)
@@ -739,7 +739,8 @@ function buildDirectiveArgs(
   } else {
     // user directive.
     // see if we have directives exposed via <script setup>
-    const fromSetup = !__BROWSER__ && resolveSetupReference(dir.name, context)
+    const fromSetup =
+      !__BROWSER__ && resolveSetupReference('v-' + dir.name, context)
     if (fromSetup) {
       dirArgs.push(fromSetup)
     } else {