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 not support import

See original GitHub issue
```[import](./_other.vue)
Text typed ere will be entiry ignored. You can use it to describe the example imported for maintenance purposes
not work?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
elevatebartcommented, Jan 19, 2021

I see from your usage of styleguide.config.js that you are using vue-styleguidist. This option is supposed to work there out of the box. If you provide a reproduction repository, I can check why this is not the case.

This feature only does not work on vue-docgen-cli.

1reaction
jd1378commented, Jan 19, 2021

Well I did find a somewhat workaround so far I found that I can do the import using updateExample() inside my styleguide.config.js. I found an example of it inside the docs and changed it a little bit:

updateExample(props, exampleFilePath) {
    const { settings, lang } = props;
    if (settings && typeof settings.file === 'string') {
      const filepath = path.resolve(
        path.dirname(exampleFilePath),
        settings.file
      );
      delete settings.file;
      const content = fs.readFileSync(filepath, 'utf-8');
      return {
        content,
        settings,
        lang,
      };
    }
    return props;
  },

then in my readme files I do this:

  ```jsx { "file": "./Example1.vue" }
  ` ``

And somehow It’s working out fine so far for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vue-docgen-api doesn't support mixins which are result of ...
Hi, I'm trying to use vue-styleguidist in a project which uses next pattern for mixins // mixin.js const factory = () => Vue.extend({}); ......
Read more >
vue-docgen-api - Vue Styleguidist
Returns and objects containing all documented and undocumented properties of the component. import { parse } from 'vue-docgen-api' var componentInfoSimple ...
Read more >
vite-plugin-vue-docgen - npm
This is a very simple Vite plugin that wraps the Vue Docgen API for providing metadata about Vue single file components (SFC). Usage....
Read more >
vue-styleguidist - Bountysource
Docgen currently doesn't extract type information for props declared using @Prop(Type) instead of @Prop({ type: Type }) . This usage is advertised in...
Read more >
Document & Test Vue 3 Components With Storybook
Unfortunately, I found no way to add JSDoc comments to the counter-update event. I think it is currently not supported in vue-docgen-api, ...
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