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) => { resolve: (name: string) => {
const { prefix } = options.components || {}; const { prefix } = options.components || {};
const cName = getName(name, prefix); 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) { if (cMeta) {
return ( return (
@ -44,7 +44,7 @@ export function PrimeVueResolver(options: PrimeVueResolverOptions = {}): Compone
resolve: (name: string) => { resolve: (name: string) => {
const { prefix } = options.directives || {}; const { prefix } = options.directives || {};
const dName = getName(name, prefix); 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) { if (dMeta) {
return ( return (