Skip to content

Commit 7ddf08d

Browse files
rayrutjeschrisvfritz
authored andcommitted
[API] add valid "number" type for "key" (vuejs#1065)
1 parent 04949ec commit 7ddf08d

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
@@ -1975,7 +1975,7 @@ if (version === 2) {
19751975

19761976
### key
19771977

1978-
- **Expects:** `string`
1978+
- **Expects:** `number | string`
19791979

19801980
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.
19811981

0 commit comments

Comments
 (0)