Skip to content

docs: Change tag prop to tag attribute #1237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/guide/migration/transition-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ badges:

## Overview

`<transition-group>` no longer renders a root element by default, but can still create one with the `tag` prop.
`<transition-group>` no longer renders a root element by default, but can still create one with the `tag` attribute.

## 2.x Syntax

In Vue 2, `<transition-group>`, like other custom components, needed a root element, which by default was a `<span>` but was customizable via the `tag` prop.
In Vue 2, `<transition-group>`, like other custom components, needed a root element, which by default was a `<span>` but was customizable via the `tag` attribute.

```html
<transition-group tag="ul">
Expand All @@ -26,7 +26,7 @@ In Vue 2, `<transition-group>`, like other custom components, needed a root elem

In Vue 3, we have [fragment support](/guide/migration/fragments.html), so components no longer _need_ a root node. Consequently, `<transition-group>` no longer renders one by default.

- If you already have the `tag` prop defined in your Vue 2 code, like in the example above, everything will work as before
- If you already have the `tag` attribute defined in your Vue 2 code, like in the example above, everything will work as before
- If you didn't have one defined _and_ your styling or other behaviors relied on the presence of the `<span>` root element to work properly, simply add `tag="span"` to the `<transition-group>`:

```html
Expand Down