Skip to content

<script setup> Support #458

Description

@dribeiro-tc

My docs were being generated correctly. Until I decided to upgrade my script tags to use script setup as Vue Docs recommends.

This led to my docs not being generated anymore.

Does jsdoc-vuejs supports <script setup>?

Activity

  1. vfiee commented on Apr 21, 2022

    @vfiee

    Are there any updates?

  2. cbecker-tc commented on Jul 19, 2022

    @cbecker-tc

    Still no updates?

  3. andrewv517 commented on Jul 28, 2022

    @andrewv517

    anything?

  4. kapitansen commented on Feb 23, 2023

    @kapitansen

    ?

  5. gzhqiang commented on Mar 30, 2023

    @gzhqiang

    ?

  6. tinawng commented on Nov 29, 2023

    @tinawng

    Changes need to be made to the source code:

    /package.json

    "@vue/compiler-sfc": "3.3.9",

    /lib/core/seekExportDefaultLine.js

    if (inScript && /export\s+default/.test(line)) {
    return i + 1; // index starts at 0, but file's lines start at 1
    }
    
    if (inScript && /<script\ssetup>/.test(line)) {
      return i;
    }

    /lib/core/vueScriptExtractor.js

    let scriptContent = parsedComponent.descriptor.script ? parsedComponent.descriptor.script.content : null;
    scriptContent ??= parsedComponent.descriptor.scriptSetup ? parsedComponent.descriptor.scriptSetup.content : '';
  7. hybridwebdev commented on Jun 19, 2024

    @hybridwebdev

    Is there any

    Changes need to be made to the source code:

    /package.json

    "@vue/compiler-sfc": "3.3.9",

    /lib/core/seekExportDefaultLine.js

    if (inScript && /export\s+default/.test(line)) {
    return i + 1; // index starts at 0, but file's lines start at 1
    }
    
    if (inScript && /<script\ssetup>/.test(line)) {
      return i;
    }

    /lib/core/vueScriptExtractor.js

    let scriptContent = parsedComponent.descriptor.script ? parsedComponent.descriptor.script.content : null;
    scriptContent ??= parsedComponent.descriptor.scriptSetup ? parsedComponent.descriptor.scriptSetup.content : '';

    Is there any chance you can submit a PR for this change? If not, I'll try my best to make one.

  8. qstarx commented on Mar 11, 2025

    @qstarx

    I submitted a pull request for this issue using suggestion from tinawng.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions