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 {
if (vnode.data.refInFor) {
if (Array.isArray(refs[key])) {
if (Array.isArray(refs[key]) && refs[key].indexOf(ref) < 0) {
refs[key].push(ref)
} else {
refs[key] = [ref]

Loading…
Cancel
Save