1.0.0-alpha.16 • Published 11 months ago

@chakra-ui/vue-auto-import v1.0.0-alpha.16

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@chakra-ui/vue-auto-import

If you use Vite, you can use this package to auto import components for you so that you needn't manually import components from Chakra UI Vue that you want to consume.

This package depends on the unplugin-vue-components to help resolve components from the template. @chakra-ui/vue-auto-import exports a componentResolverFunction that will identify Chakra UI Vue components and resolve them for you.

Installation

yarn add @chakra-ui/vue-auto-import && yarn add -D unplugin-vue-components
# or
npm i @chakra-ui/vue-auto-import && npm install --dev unplugin-vue-components

Usage

// In `vite.config.ts` file

import { defineConfig } from 'vite'
import ComponentsPlugin from 'unplugin-vue-components'
import { componentResolver } from '@chakra-ui/vue-auto-import'


export default defineConfig({
  plugins: [
    ComponentsPlugin({
      customComponentResolvers: [componentResolver]
    })
  ]
})

That's it! In your template, you can use it as follows:

<template>
  <c-alert status="info" mb="3">
    <c-alert-title> Info alert </c-alert-title>
    <c-alert-description> Something just happened </c-alert-description>
  </c-alert>
</template>
3.0.0-beta.10

1 year ago

3.0.0-beta.11

1 year ago

3.0.0-beta.5

1 year ago

3.0.0-beta.7

1 year ago

3.0.0-beta.6

1 year ago

3.0.0-beta.4

1 year ago

3.0.0-beta.3

1 year ago

3.0.0-beta.2

1 year ago

3.0.0-beta.1

1 year ago

2.0.0-beta.2

1 year ago

2.0.0-beta.1

1 year ago

1.0.0-alpha.16

1 year ago

2.0.0-beta.0

1 year ago

1.0.0-alpha.9

2 years ago

1.0.0-alpha.8

2 years ago

1.0.0-alpha.7

2 years ago

1.0.0-alpha.10

2 years ago

1.0.0-alpha.12

2 years ago

1.0.0-alpha.11

2 years ago

1.0.0-alpha.14

2 years ago

1.0.0-alpha.13

2 years ago

0.1.0-alpha.7

3 years ago

0.1.0-alpha.5

3 years ago

0.1.0-alpha.4

3 years ago

0.1.0-alpha.3

3 years ago

0.1.0-alpha.2

3 years ago

0.0.1-alpha.1

3 years ago