| nuxt component
![](https://i.imgur.com/axBPWDg.jpg)
ModuletoscanandautoimportcomponentsforNuxt2.13+TableofContentsFeaturesAutomaticallyscancomponents/directoryNoneedtomanuallyimportcomponentsanymoreMultiplepathswithcustomizableprefixesandlookup/ignorepatternsLazyloading(Asynccomponents)Productioncode-splittingoptimization(loader)HotreloadingModuleintegration(libraryauthors[1])FullytestedUsageSetthecomponentsoptioninnuxt.config:exportdefault{components:true}Note:Ifusingnuxt2.10...2.13,youhavetoalsomanuallyinstallandadd@nuxt/componentstobuildMo...
![](http://pix4.agoda.net/hotelimages/agoda-homes/5899847/61e1a790eeb181e40e8f262ea5a396dc.jpg?s=800x)
Module to scan and auto import components for Nuxt 2.13+
Table of Contents Features Automatically scan components/ directory No need to manually import components anymore Multiple paths with customizable prefixes and lookup/ignore patterns Lazy loading (Async components) Production code-splitting optimization (loader) Hot reloading Module integration (library authors[1]) Fully tested UsageSet the components option in nuxt.config:
export default { components: true }Note: If using nuxt 2.10...2.13, you have to also manually install and add @nuxt/components to buildModules inside nuxt.config.
Create your components:
| components/ ---| ComponentFoo.vue ---| ComponentBar.vueUse them whenever you want, they will be auto imported in .vue files :
<template> <ComponentFoo /> <component-bar /> </template>No need anymore to manually import them in the script section!
See live demo[2] or video ...
取得本站獨家住宿推薦 15%OFF 訂房優惠
本站住宿推薦 20%OFF 訂房優惠,親子優惠,住宿折扣,限時回饋,平日促銷
| nuxt component
components | nuxt component
Improve Your Developer Experience With Nuxt Components ... | nuxt component
Nuxt Components | nuxt component
Scan and auto import components for Nuxt.js 2.13+ | nuxt component
The components Property | nuxt component
Views | nuxt component
一起幫忙解決難題,拯救IT 人的一天 | nuxt component
![](https://i.imgur.com/axBPWDg.jpg)