mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-27 18:30:35 +01:00
feat(Avatar): use NuxtImg component when available
Resolves nuxt/ui#2078
This commit is contained in:
@@ -87,6 +87,16 @@ export {}
|
||||
`
|
||||
})
|
||||
|
||||
templates.push({
|
||||
filename: 'ui-image-component.ts',
|
||||
write: true,
|
||||
getContents: ({ app }) => {
|
||||
const image = app?.components?.find(c => c.pascalName === 'NuxtImg' && !c.filePath.includes('nuxt/dist/app'))
|
||||
|
||||
return image ? `export { default } from "${image.filePath}"` : 'export default "img"'
|
||||
}
|
||||
})
|
||||
|
||||
return templates
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user