Skip to content

No suggestions for propreties (Options API) #4074

Closed as not planned
Closed as not planned
@haug1

Description

@haug1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingduplicateThis issue or pull request already existsgood reproduction ✨This issue provides a good reproduction, we will be able to investigate it first

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions