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

Function genOnce

static/vuejs/vue.esm.js:8547–8571  ·  view source on GitHub ↗
(el)

Source from the content-addressed store, hash-verified

8545
8546// v-once
8547function genOnce (el) {
8548 el.onceProcessed = true;
8549 if (el.if && !el.ifProcessed) {
8550 return genIf(el)
8551 } else if (el.staticInFor) {
8552 var key = '';
8553 var parent = el.parent;
8554 while (parent) {
8555 if (parent.for) {
8556 key = parent.key;
8557 break
8558 }
8559 parent = parent.parent;
8560 }
8561 if (!key) {
8562 process.env.NODE_ENV !== 'production' && warn$3(
8563 "v-once can only be used inside v-for that is keyed. "
8564 );
8565 return genElement(el)
8566 }
8567 return ("_o(" + (genElement(el)) + "," + (onceCount++) + (key ? ("," + key) : "") + ")")
8568 } else {
8569 return genStatic(el)
8570 }
8571}
8572
8573function genIf (el) {
8574 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