|
@@ -493,8 +493,10 @@ function checkElementDirectives (el, options) {
|
|
|
function checkComponent (el, options) {
|
|
function checkComponent (el, options) {
|
|
|
var component = _.checkComponent(el, options)
|
|
var component = _.checkComponent(el, options)
|
|
|
if (component) {
|
|
if (component) {
|
|
|
|
|
+ var ref = _.findRef(el)
|
|
|
var descriptor = {
|
|
var descriptor = {
|
|
|
name: 'component',
|
|
name: 'component',
|
|
|
|
|
+ ref: ref,
|
|
|
expression: component.id,
|
|
expression: component.id,
|
|
|
def: internalDirectives.component,
|
|
def: internalDirectives.component,
|
|
|
modifiers: {
|
|
modifiers: {
|
|
@@ -502,6 +504,9 @@ function checkComponent (el, options) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
var componentLinkFn = function (vm, el, host, scope, frag) {
|
|
var componentLinkFn = function (vm, el, host, scope, frag) {
|
|
|
|
|
+ if (ref) {
|
|
|
|
|
+ _.defineReactive((scope || vm).$refs, ref, null)
|
|
|
|
|
+ }
|
|
|
vm._bindDir(descriptor, el, host, scope, frag)
|
|
vm._bindDir(descriptor, el, host, scope, frag)
|
|
|
}
|
|
}
|
|
|
componentLinkFn.terminal = true
|
|
componentLinkFn.terminal = true
|
|
@@ -568,7 +573,14 @@ function makeTerminalNodeLinkFn (el, dirName, value, options, def) {
|
|
|
// either an element directive, or if/for
|
|
// either an element directive, or if/for
|
|
|
def: def || publicDirectives[dirName]
|
|
def: def || publicDirectives[dirName]
|
|
|
}
|
|
}
|
|
|
|
|
+ // check ref for v-for
|
|
|
|
|
+ if (dirName === 'for') {
|
|
|
|
|
+ descriptor.ref = _.findRef(el)
|
|
|
|
|
+ }
|
|
|
var fn = function terminalNodeLinkFn (vm, el, host, scope, frag) {
|
|
var fn = function terminalNodeLinkFn (vm, el, host, scope, frag) {
|
|
|
|
|
+ if (descriptor.ref) {
|
|
|
|
|
+ _.defineReactive((scope || vm).$refs, descriptor.ref, null)
|
|
|
|
|
+ }
|
|
|
vm._bindDir(descriptor, el, host, scope, frag)
|
|
vm._bindDir(descriptor, el, host, scope, frag)
|
|
|
}
|
|
}
|
|
|
fn.terminal = true
|
|
fn.terminal = true
|