* Build a node link function for a terminal directive. * A terminal link function terminates the current * compilation recursion and handles compilation of the * subtree in the directive. * * @param {Element} el * @param {String} dirName * @param {String} value * @param {Obje
(el, dirName, value, options, def, rawName, arg, modifiers)
| 7429 | */ |
| 7430 | |
| 7431 | function makeTerminalNodeLinkFn(el, dirName, value, options, def, rawName, arg, modifiers) { |
| 7432 | var parsed = parseDirective(value); |
| 7433 | var descriptor = { |
| 7434 | name: dirName, |
| 7435 | arg: arg, |
| 7436 | expression: parsed.expression, |
| 7437 | filters: parsed.filters, |
| 7438 | raw: value, |
| 7439 | attr: rawName, |
| 7440 | modifiers: modifiers, |
| 7441 | def: def |
| 7442 | }; |
| 7443 | // check ref for v-for and router-view |
| 7444 | if (dirName === 'for' || dirName === 'router-view') { |
| 7445 | descriptor.ref = findRef(el); |
| 7446 | } |
| 7447 | var fn = function terminalNodeLinkFn(vm, el, host, scope, frag) { |
| 7448 | if (descriptor.ref) { |
| 7449 | defineReactive((scope || vm).$refs, descriptor.ref, null); |
| 7450 | } |
| 7451 | vm._bindDir(descriptor, el, host, scope, frag); |
| 7452 | }; |
| 7453 | fn.terminal = true; |
| 7454 | return fn; |
| 7455 | } |
| 7456 | |
| 7457 | /** |
| 7458 | * Compile the directives on an element and return a linker. |
no test coverage detected