Skip to content

ComputedRef generated in setup function no longer has .value stripped off it's type in template #419

@yankeeinlondon

Description

@yankeeinlondon

After coming back to a repo that had been working fine I now find that when define a reactive object with this strongly typed function:

2021-08-25_11-46-23 (3)

and then pass s as return value in setup. The template incorrectly reports missing properties that in fact do exist at runtime:

2021-08-25_11-49-12

in all cases the error on the template hover follows this pattern:

Property 'wrapper' does not exist on type 'ComputedRef<Record<"root" | "wrapper" | "input" | "info" | "warn" | "error" | "inputControl" | "inputRow", string>>'

My expectation would be that a ComputedRef defined in the setup() function would have the .value stripped off it for type checking in the template. That is correct, right? I mean it does work so clearly VueJS is stripping off the .value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions