(el)
| 8541 | |
| 8542 | // v-once |
| 8543 | function 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 | |
| 8569 | function genIf (el) { |
| 8570 | el.ifProcessed = true; // avoid recursion |
no test coverage detected