forked from vuejs/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat(migration): transition-group document fragment default behaviour * Update src/guide/migration/transition-group.md * Update src/guide/migration/transition-group.md * Update src/guide/migration/transition-group.md * Update src/guide/migration/transition-group.md * Update src/guide/transitions-list.md * Update src/guide/migration/transition-group.md * add transition-group to config Co-authored-by: Thorsten Luenborg <t.luneborg@googlemail.com> Co-authored-by: Sarah Drasner <sarah.drasner@gmail.com>
- Loading branch information
Showing
6 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
title: Transition Group Root Element | ||
badges: | ||
- breaking | ||
--- | ||
|
||
# {{ $frontmatter.title }} <MigrationBadges :badges="$frontmatter.badges" /> | ||
|
||
## Overview | ||
|
||
`<transition-group>` no longer renders a root element by default, but can still create one with the `tag` prop. | ||
|
||
## 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. | ||
|
||
```html | ||
<transition-group tag="ul"> | ||
<li v-for="item in items" :key="item"> | ||
{{ item }} | ||
</li> | ||
</transition-group> | ||
``` | ||
|
||
## 3.x Syntax | ||
|
||
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 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 | ||
<transition-group tag="span"> | ||
<!-- --> | ||
</transition-group> | ||
``` | ||
|
||
## See also | ||
|
||
- [Some transition classes got a rename](/guide/migration/transition.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters