question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

vue-docgen-cli: Slots with dynamic name are not documented

See original GitHub issue

Hi 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:closed
  • Created 2 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sawmuraicommented, Oct 11, 2022

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:

@slot name - description till EOL
1reaction
elevatebartcommented, Mar 3, 2022

Great idea !!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found