How to properly document a script setup
component with JsDoc?
#8078
Unanswered
rodrigocfd
asked this question in
Help/Questions
Replies: 2 comments 1 reply
-
enable vue/require-prop-comment |
Beta Was this translation helpful? Give feedback.
0 replies
-
One method described at https://stackoverflow.com/q/72003493/ is to add an extra non-setup script tag with a default export that a doc comment can apply to: <script lang="ts">
/** This is a nice component */
export default {};
</script>
<script setup lang="ts">
// Rest of the code here...
</script> This seems to be parsed properly at least in VSCode, but I don't know about other JSDoc tools. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In React, since components are explicitly written as functions, documentation with JSDoc is trivial:
How are we supposed to apply JSDoc to Vue 3 components written with the
script setup
syntax?Beta Was this translation helpful? Give feedback.
All reactions