Skip to content

Cannot see comments when defining an prop with default options #1434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
asdjtx opened this issue Jun 9, 2022 · 3 comments
Closed

Cannot see comments when defining an prop with default options #1434

asdjtx opened this issue Jun 9, 2022 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@asdjtx
Copy link

asdjtx commented Jun 9, 2022

<!-- Child.vue -->
<template>
  <div>Child</div>
</template>

<script setup lang="ts">
const props = defineProps({
  /** 注释 */
  count: {
    type: Number,
    default: 10
  }
})
</script>
<!-- Parent.vue -->
<template>
  <child :count="1"></child>
</template>

<script setup lang="ts">
import child from './Child.vue'
</script>

When the mouse is over, cannot see the comment, and cannot jump to the definition by ctrl+ left clicking

image

After deleting the default option, can see the definition information and display the jump

<!-- Child.vue  -->
<template>
  <div>Child</div>
</template>

<script setup lang="ts">
const props = defineProps({
  /** 注释 */
  count: {
    type: Number,
    // default: 10
  }
})
</script>

image

Use <script> object props has the same problem,but use <script setup> withDefaults() does not
This is a feature or what should I set ?

The operating environment is as follows

VSCode:1.66.2
Vue:3.2.31
Volar:0.34.14
TS:4.6.3(takeover)
@johnsoncodehk
Copy link
Member

This is upstream issue and fixed in vuejs/core#5871, please update your vue version to > 3.2.34.

@johnsoncodehk
Copy link
Member

Duplicate of #1261

@johnsoncodehk johnsoncodehk marked this as a duplicate of #1261 Jun 9, 2022
@johnsoncodehk johnsoncodehk added the duplicate This issue or pull request already exists label Jun 9, 2022
@hasan-almujtaba
Copy link

hasan-almujtaba commented Nov 26, 2022

I have updated the vue version to 3.2.45 but JSDOC still not showing.
Here is my component props:

const props = withDefaults(
  defineProps<{
    /**
     * The variant to use.
     * @default filled
     */
    variant?: Variant
    /**
     * The color of the component.
     * @default primary
     */
    colorScheme?: ColorScheme
    /**
     * Loading state of the component
     * @default false
     */
    loading?: boolean
  }>(),
  {
    variant: 'filled',
    colorScheme: 'primary',
    loading: false,
  }
)

JSDOC still missing in here

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants