Fixed #5980 - Nuxt module component autoImport in v4 rc3 doesn't work with component prefixes

pull/6011/head
Mert Sincan 2024-06-30 21:33:35 +01:00
parent 8f1952d1f0
commit ff96f62e7a
1 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ export function PrimeVueResolver(options: PrimeVueResolverOptions = {}): Compone
resolve: (name: string) => {
const { prefix } = options.components || {};
const cName = getName(name, prefix);
const cMeta = components.find((c) => c.name.toLocaleLowerCase() === cName.toLocaleLowerCase());
const cMeta = components.find((c) => c.name.toLocaleLowerCase() === cName?.toLocaleLowerCase());
if (cMeta) {
return (
@ -44,7 +44,7 @@ export function PrimeVueResolver(options: PrimeVueResolverOptions = {}): Compone
resolve: (name: string) => {
const { prefix } = options.directives || {};
const dName = getName(name, prefix);
const dMeta = directives.find((d) => d.name.toLocaleLowerCase() === dName.toLocaleLowerCase());
const dMeta = directives.find((d) => d.name.toLocaleLowerCase() === dName?.toLocaleLowerCase());
if (dMeta) {
return (