Skip to content

Commit 5f92c59

Browse files
authored
docs: Add types of key (#1238)
1 parent b8c599f commit 5f92c59

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/api/special-attributes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## key
44

5-
- **Expects:** `number | string`
5+
- **Expects:** `number | string | symbol `
66

77
The `key` special attribute is primarily used as a hint for Vue's virtual DOM algorithm to identify VNodes when diffing the new list of nodes against the old list. Without keys, Vue uses an algorithm that minimizes element movement and tries to patch/reuse elements of the same type in-place as much as possible. With keys, it will reorder elements based on the order change of keys, and elements with keys that are no longer present will always be removed/destroyed.
88

0 commit comments

Comments
 (0)