[Vuejs]-Why are the Vue props wrapped in `Partial<>`?

1👍

Okay, I think I figured it out.

As @zenly said, the Partial wasn’t the cause of the error. The error was that Volar / TypeScript was inferring the type of pageType within VSCode as 'link' | 'collection' but it wasn’t actually of that type, because Vue’s language services weren’t correctly inferring the type of pageType by the time it was bound to the template (and was inferring that it was just a string).

I fixed it by explicitly defining pageType as that type.

Leave a comment