Browse Source

avoid pushing the same ref more than once (fix #4253)

dev
Evan You 8 years ago
parent
commit
06f41ad9fe
  1. 2
      src/core/vdom/modules/ref.js

2
src/core/vdom/modules/ref.js

@ -32,7 +32,7 @@ export function registerRef (vnode: VNodeWithData, isRemoval: ?boolean) {
} }
} else { } else {
if (vnode.data.refInFor) { if (vnode.data.refInFor) {
if (Array.isArray(refs[key])) { if (Array.isArray(refs[key]) && refs[key].indexOf(ref) < 0) {
refs[key].push(ref) refs[key].push(ref)
} else { } else {
refs[key] = [ref] refs[key] = [ref]

Loading…
Cancel
Save