Skip to content

Commit b0a8f7a

Browse files
authored
fix: Add "boolean" and "symbol" types for "key" attribute. (#2614)
Booleans as keys are supported since v2.4.2 and symbols since v2.5.12.
1 parent 3926816 commit b0a8f7a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/v2/api/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2379,7 +2379,7 @@ type: api
23792379
23802380
### key
23812381
2382-
- **Expects:** `number | string`
2382+
- **Expects:** `number | string | boolean (since 2.4.2) | symbol (since 2.5.12)`
23832383
23842384
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.
23852385

0 commit comments

Comments
 (0)