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:
@@ -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" />
|
||||
```
|
||||
12
packages/lucide-vue/nuxt.js
Normal file
12
packages/lucide-vue/nuxt.js
Normal 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']
|
||||
})
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user