Evan You
9 years ago
1 changed files with 0 additions and 10 deletions
@ -1,10 +0,0 @@ |
|||||
export function ref (el, dir) { |
|
||||
if (!el.hooks) el.hooks = {} |
|
||||
const code = `$refs["${dir.arg}"]=vnode.elm || vnode.data.child` |
|
||||
if (el.hooks.insert) { |
|
||||
el.hooks.insert = el.hooks.insert |
|
||||
.replace(/^function\(vnode\)\{(.*)\}$/, `function(vnode){$1;${code}}`) |
|
||||
} else { |
|
||||
el.hooks.insert = `function(vnode){${code}}` |
|
||||
} |
|
||||
} |
|
Loading…
Reference in new issue