File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -115,12 +115,12 @@ export function parse (
115
115
processFor ( element )
116
116
processIf ( element )
117
117
processOnce ( element )
118
+ processKey ( element )
118
119
119
120
// determine whether this is a plain element after
120
121
// removing structural attributes
121
122
element . plain = ! element . key && ! attrs . length
122
123
123
- processKey ( element )
124
124
processRef ( element )
125
125
processSlot ( element )
126
126
processComponent ( element )
@@ -258,6 +258,9 @@ function processRawAttrs (el) {
258
258
function processKey ( el ) {
259
259
const exp = getBindingAttr ( el , 'key' )
260
260
if ( exp ) {
261
+ if ( process . env . NODE_ENV !== 'production' && el . tag === 'template' ) {
262
+ warn ( `<template> cannot be keyed. Place the key on real elements instead.` )
263
+ }
261
264
el . key = exp
262
265
}
263
266
}
You can’t perform that action at this time.
0 commit comments