mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 17:35:57 +00:00
fix(components): remove invalid chars from component names (#253)
This commit is contained in:
parent
1518a2a070
commit
c124967d8c
@ -1,7 +1,7 @@
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
<%= components.map(c => {
|
||||
return ` ${c.pascalName}: typeof import('${c.filePath}')['${c.export}']`
|
||||
return ` '${c.pascalName}': typeof import('${c.filePath}')['${c.export}']`
|
||||
}).join(',\n') %>
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ const components = {
|
||||
c.preload === true || typeof c.preload === 'number' ? `webpackPreload: ${c.preload}` : false,
|
||||
].filter(Boolean).join(', ')
|
||||
|
||||
return ` ${c.pascalName}: defineAsyncComponent(() => import('${c.filePath}' /* ${magicComments} */).then(c => ${exp}))`
|
||||
return ` '${c.pascalName}': defineAsyncComponent(() => import('${c.filePath}' /* ${magicComments} */).then(c => ${exp}))`
|
||||
}).join(',\n') %>
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ export async function scanComponents (dirs: ScanDir[], srcDir: string): Promise<
|
||||
}
|
||||
resolvedNames.set(componentName, filePath)
|
||||
|
||||
const pascalName = pascalCase(componentName)
|
||||
const pascalName = pascalCase(componentName).replace(/["']/g, '')
|
||||
const kebabName = hyphenate(componentName)
|
||||
const shortPath = relative(srcDir, filePath)
|
||||
const chunkName = 'components/' + kebabName
|
||||
|
Loading…
Reference in New Issue
Block a user