Skip to content

<Transition> does not support :key binding when use v-for #8682

Closed
@KawaiiZapic

Description

@KawaiiZapic

Vue version

3.3.4

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-xcl8cd

Steps to reproduce

<template>
  <transition v-for="i in 5" :key="i">
    {{ i }}
  </transition>
</template>

Run vue-tsc

What is expected?

Type check is passed.

What is actually happening?

error TS2345: Argument of type '{ key: number; }' is not assignable to parameter of type 'TransitionProps'.
  Object literal may only specify known properties, and 'key' does not exist in type 'TransitionProps'.

2   <transition v-for="i in 5" :key="i">
                               ~~~~

System Info

No response

Any additional comments?

Only <Transition> has this problem, <TransitionGroup> work fine

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions