Skip to content

Type issues with Transition and latest Vue 2.x #3881

@rchl

Description

@rchl

With latest Vue 2 version (currently 2.7.16) this code creates a type issue:

<template>
  <transition>
    <span v-show="true">Foo</span>
  </transition>
</template>

Object literal may only specify known properties, and 'persisted' does not exist in type 'Readonly<Partial<{}> & Omit<Readonly, undefined>>'. ​ts(2353)

The issue appears to be due to @vue/compiler-dom adding a persisted prop to the transition node when parsing such construct and Volar adding it to the generated template code which, combined with the latest version of Vue 2 which includes proper types for the Transition component, causes this issue. Previously the type of Transition component was something less strict or unknown so there was no issue.

(there is also an issue with using a key attribute but that is maybe an issue with Vue types)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood 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