feat(sfc): support namespaced component tags when using <script setup>

This commit is contained in:
Evan You
2021-07-15 11:17:59 -04:00
parent a8edf2bdff
commit e5a4412764
2 changed files with 61 additions and 0 deletions

View File

@@ -301,6 +301,13 @@ export function resolveComponentType(
if (fromSetup) {
return fromSetup
}
const dotIndex = tag.indexOf('.')
if (dotIndex > 0) {
const ns = resolveSetupReference(tag.slice(0, dotIndex), context)
if (ns) {
return ns + tag.slice(dotIndex)
}
}
}
// 4. Self referencing component (inferred from filename)