Skip to content

Commit

Permalink
fix: key used in the type declaration
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
ferferga authored Mar 27, 2024
1 parent 286e26e commit a37e25e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/plugins/src/resolver/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ export default function (options: ResolverOptions = {}): ComponentResolver {
type: 'component',
resolve: (name: string) => {
if (name.toLowerCase().startsWith(prefix.toLowerCase())) {
const componentName = name.substring(prefix.length).split('.')[0]
const isNamespacedComponent = Object.keys(NamespacedComponents).includes(componentName)
const isComponent = Object.values(components).flat().includes(componentName)
const componentName = name.split('.')[0]
const importName = componentName.substring(prefix.length)
const isNamespacedComponent = Object.keys(NamespacedComponents).includes(importName)
const isComponent = Object.values(components).flat().includes(importName)
if (isNamespacedComponent || isComponent) {
return {
name: componentName,
name: importName,
as: componentName,
from: isNamespacedComponent && namespaced ? 'radix-vue/namespaced' : 'radix-vue',
}
}
Expand Down

0 comments on commit a37e25e

Please sign in to comment.