vue-docgen-cli: Slots with dynamic name are not documented
See original GitHub issueHi and thanks for this nice project!
Current behavior
Slots with a dynamic name are not documented in the generated file when using vue-docgen-cli
To reproduce Use a slot like this:
<!-- @slot slot for prepend on input -->
<slot :name="`prepend-${property}`"></slot>
Render:
## Slots
| Name | Description | Bindings |
| -------- | -------------------------------- | ------------ |
| default | slot for prepend on input | |
Expected behavior
Slots with dynamic names should be correctly documented
Edit
What I expected:
| Name | Description | Bindings |
| ----------------------------- | ----------------------------------- | ----------- |
| `prepend-${property}` | slot for prepend on input | |
Or get the name in the comment this for example:
<!-- @slot prepend[property] - slot for prepend on input -->
<slot :name="`prepend-${property}`"></slot>
would return this:
| Name | Description | Bindings |
| ------------------------- | -------------------------------- | ------------ |
| prepend[property] | slot for prepend on input | |
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
vue.js - How to declare a list of slots with dynamic names and ...
When I tried this I got a compiler error about not being allowed to key <template> elements, but we can key the <component>...
Read more >vue-docgen-cli | Yarn - Package Manager
Generate documentation markdown files from VueJs components using the vue-docgen-api. Install. Install the module directly from npm: yarn add -D vue-docgen-cli ...
Read more >Slots - Vue.js
When a component accepts both a default slot and named slots, all top-level non- <template> nodes are implicitly treated as content for the...
Read more >Cookbook - Vue Styleguidist
Problem: I do not want to document any component whose filename starts with an underscore ( _ ). module.exports = { // load...
Read more >A Look at Vue's Scoped Slots - Telerik
Your <Card> exposes a name slot that is being defaulted to the Pokemon's ... If you want to look at the documentation for...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
No problem, I added a PR. This will probably require some documentation update in the end, would it not?
I went with @J3m5 's suggestion for the format of the name from a comment:
Great idea !!