Support Nuxt auto-importing Vue components (#390)

* Add support for nuxt component auto importing

* Add documentation for using with nuxt components
This commit is contained in:
venashial
2021-08-31 11:58:13 -07:00
committed by GitHub
parent c97b456bce
commit cd7b9bf03d
2 changed files with 30 additions and 0 deletions

View File

@@ -105,3 +105,21 @@ export default {
</div>
</template>
```
## Use with [@nuxt/components](https://github.com/nuxt/components#readme)
### Setup
In your `nuxt.config.js`, add `lucide-vue/nuxt` to your `buildModules`
```js
export default {
buildModules: ['lucide-vue/nuxt']
}
```
### How to use
Icon components are prefixed with `Icon`. Use icon components without importing them.
### Example
```html
<IconCamera color="red" :size="32" />
```

View File

@@ -0,0 +1,12 @@
import { join } from 'path'
export default function () {
this.nuxt.hook('components:dirs', dirs => {
dirs.push({
path: join(__dirname, 'dist', 'esm', 'icons'),
prefix: 'Icon',
ignore: ['**/index.js']
})
})
}