MCPcopy Create free account
hub / github.com/keepfool/vue-tutorials / findPrevFrag

Function findPrevFrag

06.Router/basic/js/vue.js:4532–4544  ·  view source on GitHub ↗

* Helper to find the previous element that is a fragment * anchor. This is necessary because a destroyed frag's * element could still be lingering in the DOM before its * leaving transition finishes, but its inserted flag * should have been set to false so we can skip them. * * If

(frag, anchor, id)

Source from the content-addressed store, hash-verified

4530 */
4531
4532 function findPrevFrag(frag, anchor, id) {
4533 var el = frag.node.previousSibling;
4534 /* istanbul ignore if */
4535 if (!el) return;
4536 frag = el.__v_frag;
4537 while ((!frag || frag.forId !== id || !frag.inserted) && el !== anchor) {
4538 el = el.previousSibling;
4539 /* istanbul ignore if */
4540 if (!el) return;
4541 frag = el.__v_frag;
4542 }
4543 return frag;
4544 }
4545
4546 /**
4547 * Find a vm from a fragment.

Callers 1

vue.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected