Every line of 'html if else' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
257 function genIf (el) { 258 el.ifProcessed = true; 259 if (!el.ifConditions.length) { 260 return '_e()'; 261 } 262 return `(${el.ifConditions[0].exp})?${genElement(el.ifConditions[0].block)}: _e()` 263 }
133 if(expression) { 134 return { 135 $type: "if", 136 condition: this._getParamNames(arguments[0])[0], 137 expression: expression, 138 children: arguments[1] 139 } 140 }
119 function genIf (el: any): string { 120 el.ifProcessed = true // avoid recursion 121 return genIfConditions(el.ifConditions.slice()) 122 }
33 export function If({ condition, children }) { 34 if (children == null) { 35 return null; 36 } 37 38 const conditionResult = getConditionResult(condition) 39 40 return ( 41 42 {[].concat(children).find(c => (c.type !== Else) ^ !conditionResult) || 43 null} 44 45 ); 46 }
22 function IF(condition, ifContents, elseContents){ 23 this.condition = condition; 24 this.ifContents = ifContents; 25 this.elseContents = elseContents; 26 }
30 get tagName () { 31 return 'elseif' 32 }
145 export function genIf ( 146 el: any, 147 state: CodegenState, 148 altGen?: Function, 149 altEmpty?: string 150 ): string { 151 el.ifProcessed = true // avoid recursion 152 return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty) 153 }
60 get if() { 61 const ifNode = new Node(); 62 ifNode.parent = this._current; 63 this._current.set(keyword.IF, ifNode); 64 this._current = ifNode; 65 return this; 66 }