Skip to content
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

Props not recognized by intellisense (options API) #3888

Closed
mauromascarenhas opened this issue Feb 9, 2024 · 1 comment
Closed

Props not recognized by intellisense (options API) #3888

mauromascarenhas opened this issue Feb 9, 2024 · 1 comment
Labels

Comments

@mauromascarenhas
Copy link

mauromascarenhas commented Feb 9, 2024

Issue

As the title states, props are not being recognized by intellisense in options API (data and computed are still working as expected). Thus, no suggestion or type inference is made.

Screenshots

Prop being treated as "any"

Screenshot showing that the "id" prop is being treated as type "any"

Prop is not recognized/recommended by intellisense

Screenshot showing that the "id" prop is not being recognized by the intellisense

Prop is part of "this"

Screenshot showing that the "id" prop is being recognized as owned by the current object instance

Steps to reproduce

By using the following code (used About view from project initialization as a base), it is possible to notice that the id prop is not recognized (link to playground):

<template>
  <div class="about">
    <h1>This is an about page</h1>
    <div>A simple test text: {{ textTestSample }}</div>
    <div>A simple test number: {{ idPlusOne }}</div>
  </div>
</template>

<script>
import { defineComponent } from "vue";

export default defineComponent({
  props: {
    id: {
      type: Number,
      default: 0
    }
  },
  data(){
    return {
      dataTest: ""
    };
  },
  computed: {
    idPlusOne(){ return this.id + 1; },
    textTestSample(){ return this.dataTest + " - sample"; }
  },
  methods: {
    log(){
      console.log(this.id, this.dataTest);
    }
  }
});
</script>

<style>
@media (min-width: 1024px) {
  .about {
    min-height: 100vh;
    display: flex;
    align-items: center;
  }
}
</style>

Environment

  • OS: Windows 11;
  • IDE: VS Code 1.86.1;
  • TS: 5.3.2 (it does not matter whether it is running under takeover mode or not);
  • VLF + TS Plugin: 1.8.27.
@so1ve
Copy link
Member

so1ve commented Feb 10, 2024

Seemed to be a vue core issue. vuejs/core#9296

@so1ve so1ve closed this as completed Feb 10, 2024
@so1ve so1ve closed this as not planned Won't fix, can't repro, duplicate, stale Feb 10, 2024
@so1ve so1ve added the upstream label Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants