diff --git a/src/utils/magic.js b/src/utils/magic.js index 7b0b4d12a..c90787d65 100644 --- a/src/utils/magic.js +++ b/src/utils/magic.js @@ -69,7 +69,9 @@ export function updateChildren(root, valMap = {}) { updateMap(valMap, child.nodeName); child.setAttribute( 'data-key', - `${child.nodeName}-${valMap[child.nodeName]}` + 'key' in child.dataset + ? child.dataset.key + : `${child.nodeName}-${valMap[child.nodeName]}` ); } if (child.nodeType === 3) {