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

Function genOnce

static/vuejs/vue.common.js:8549–8573  ·  view source on GitHub ↗
(el)

Source from the content-addressed store, hash-verified

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