- From the terminal run:
npm install vue-styleguidist-auto-sections --save-dev
- In your project (must have vue-style-guidist installed) open your
styleguide.config.js
- Add a requirement
let DirSections = require('vue-styleguidist-auto-sections');
- In the
module.exports
for vue-styleguidist addsections: DirSections.getSections()
Example styleguide.config.js
let DirSections = require('vue-styleguidist-auto-sections');
module.exports = {
sections: DirSections.getSections(),
}
BasePath
- Description
- The root directory you wish to search for components and folders
- Type
- string
- Default
'./src/components/'
BaseSectionTitle
- Description
- The name for the section that correlates to the
BasePath
- The name for the section that correlates to the
- Type
- string
- Default
'Miscellaneous'
ComponentsRegex
- Description
- The regular expression to be used to locate your components
- Type
- string
- Default
'[A-Z]*.vue'
Verbose
- Description
- Will it output verbose information as it scans directories
- Type
- boolean
- Default
false
let DirSections = require('vue-styleguidist-auto-sections');
module.exports = {
sections: DirSections.getSections({
BasePath: './src/components/documentthese',
BaseSectionTitle: "Extra bits",
ComponentsRegex: "*.vue",
Verbose: true,
})
}