Skip to content

Supports scanning files and automatically imports all components #823

Open

Description

@guaijie

Clear and concise description of the problem

// components/index.ts

export { default as Table } from './Table'
export { default as Form} from './Form'

export default Button

vite.config.ts

export default defineConfig({
  plugins: [
    vue(),
    components({
      dirs: ['src/components/index.ts']
    })
  ]
})
``

components.d.ts
```ts
declare module 'vue' {
  export interface GlobalComponents {
    Table: typeof import('./src/components/index.ts')['Table'],
    Form: typeof import('./src/components/index.ts')['Form']
    Button: typeof import('./src/components/index.ts')['default']
  }
}

Suggested solution

no response

Alternative

No response

Additional context

No response

Validations

Activity

  1. ilyaliao commented on Aug 28, 2025

    @ilyaliao
    Collaborator

    Could you elaborate more?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions