Skip to content

[Vue 3] typed props as unknown #768

@Ribeiro-Tiago

Description

@Ribeiro-Tiago

Hey, just wanna start off by saying that I'm not 100% sure if it's a volar or vue issue, but the problem goes away when I disable volar

I'm using SFC and I'm have an issue where the prop typings are not correctly determined, but are assigned as unknown instead. E.g.: I have this component:

<template>
  <a :href="foo">foo</a>
</template>

<script lang="ts">
  import { defineComponent } from "vue";

  export default defineComponent({
    props: {
      someProp: { type: String, required: true },
    },
    computed: {
      foo() {
        return this.someProp.includes("foo") ? this.someProp : this.someProp;
      },
    },
  });
</script>

which gives me these 2 errors

image

image

I'm using:
vue: ^3.2.24
vite: ^2.0.0
typescript: ~4.1.5

Not really sure how the project was generated, but I think it was a mix of vite and vuetify create tools

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions