Skip to content

No suggestions for propreties (Options API) #4074

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
haug1 opened this issue Mar 12, 2024 · 2 comments
Closed

No suggestions for propreties (Options API) #4074

haug1 opened this issue Mar 12, 2024 · 2 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@haug1
Copy link

haug1 commented Mar 12, 2024

As seen below the property "something" does not get suggested on the OptionsAPIComponent.
Also no reported error on either even though they're missing the required property.

To reproduce, use below code. I set up a project with npm create vue and no to everything except eslint+prettier, then add the components.

<script>
import OptionsAPIComponent from './OptionsAPIComponent.vue'
import CompositionAPIComponent from './CompositionAPIComponent.vue'
export default {
  components: {
    OptionsAPIComponent,
    CompositionAPIComponent
  }
}
</script>
<template>
  <OptionsAPIComponent />
  <CompositionAPIComponent />
</template>
<template>
  <div>{{ something }}</div>
</template>
<script>
export default {
  props: {
    something: {
      type: String,
      required: true
    }
  }
}
</script>
<script setup>
defineProps({
  something: {
    type: String,
    required: true
  }
})
</script>
<template>
  <div>{{ something }}</div>
</template>

Property is not suggested externally on component reference

image

image

Property is not suggested internally in template

image

image

Property is not suggested on component instance

image

Method is not suggested on component instance

image

After adding data() to the component resolves a lot of LSP issues

image

But not reference to internal properties

image

Properties are correctly suggested under the $props property (when data() is specified)

image

@haug1
Copy link
Author

haug1 commented Mar 14, 2024

I see other issues labelled with "good reproduction", please let me know if I can provide any more information? Was I not able to make myself understood in the issue description?

@so1ve so1ve added pending triage good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first bug Something isn't working and removed pending triage labels Mar 15, 2024
@so1ve so1ve added bug Something isn't working duplicate This issue or pull request already exists good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first and removed bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first labels Mar 15, 2024
@so1ve
Copy link
Member

so1ve commented Mar 15, 2024

Duplicate of #3690

@so1ve so1ve marked this as a duplicate of #3690 Mar 15, 2024
@so1ve so1ve closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first
Projects
None yet
Development

No branches or pull requests

2 participants