MCPcopy Create free account
hub / github.com/TruthHun/BookStack / genOnce

Function genOnce

static/vuejs/vue.js:8543–8567  ·  view source on GitHub ↗
(el)

Source from the content-addressed store, hash-verified

8541
8542// v-once
8543function genOnce (el) {
8544 el.onceProcessed = true;
8545 if (el.if && !el.ifProcessed) {
8546 return genIf(el)
8547 } else if (el.staticInFor) {
8548 var key = '';
8549 var parent = el.parent;
8550 while (parent) {
8551 if (parent.for) {
8552 key = parent.key;
8553 break
8554 }
8555 parent = parent.parent;
8556 }
8557 if (!key) {
8558 "development" !== 'production' && warn$3(
8559 "v-once can only be used inside v-for that is keyed. "
8560 );
8561 return genElement(el)
8562 }
8563 return ("_o(" + (genElement(el)) + "," + (onceCount++) + (key ? ("," + key) : "") + ")")
8564 } else {
8565 return genStatic(el)
8566 }
8567}
8568
8569function genIf (el) {
8570 el.ifProcessed = true; // avoid recursion

Callers 2

genElementFunction · 0.70
genTernaryExpFunction · 0.70

Calls 3

genIfFunction · 0.70
genElementFunction · 0.70
genStaticFunction · 0.70

Tested by

no test coverage detected