Skip to content

Supports scanning files and automatically imports all components #823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
guaijie opened this issue Feb 10, 2025 · 0 comments
Open
3 tasks done

Supports scanning files and automatically imports all components #823

guaijie opened this issue Feb 10, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@guaijie
Copy link

guaijie commented Feb 10, 2025

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

@guaijie guaijie added the enhancement New feature or request label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant