* Check if an element is a component. If yes, return * a component link function. * * @param {Element} el * @param {Object} options * @return {Function|undefined}
(el, options)
| 7338 | */ |
| 7339 | |
| 7340 | function checkComponent(el, options) { |
| 7341 | var component = checkComponentAttr(el, options); |
| 7342 | if (component) { |
| 7343 | var ref = findRef(el); |
| 7344 | var descriptor = { |
| 7345 | name: 'component', |
| 7346 | ref: ref, |
| 7347 | expression: component.id, |
| 7348 | def: internalDirectives.component, |
| 7349 | modifiers: { |
| 7350 | literal: !component.dynamic |
| 7351 | } |
| 7352 | }; |
| 7353 | var componentLinkFn = function componentLinkFn(vm, el, host, scope, frag) { |
| 7354 | if (ref) { |
| 7355 | defineReactive((scope || vm).$refs, ref, null); |
| 7356 | } |
| 7357 | vm._bindDir(descriptor, el, host, scope, frag); |
| 7358 | }; |
| 7359 | componentLinkFn.terminal = true; |
| 7360 | return componentLinkFn; |
| 7361 | } |
| 7362 | } |
| 7363 | |
| 7364 | /** |
| 7365 | * Check an element for terminal directives in fixed order. |
no test coverage detected