File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
packages/@lwc/perf-benchmarks-components/src/benchmark/expression Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 55For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
66-->
77< template >
8+ <!-- Basic expressions (already working) -->
89 < div data-foo ="{expr1()} "> </ div >
910 < p class ="{expr2.expr21.expr22} "> </ p >
1011 < p > {expr3[0]['expr3' + '3']}</ p >
12+
13+ <!-- Complex expressions that require experimentalComplexExpressions -->
14+ < div class ="{`complex-${expr1()}-${expr2.expr21.expr22}`} ">
15+ {`Template literal: ${expr1()} and ${expr2.expr21.expr22}`}
16+ </ div >
17+
18+ < p data-computed ="{expr1() ? 'truthy' : 'falsy'} ">
19+ {expr1() ? 'Conditional: ' + expr1() : 'Default value'}
20+ </ p >
21+
22+ < div class ="{expr2?.expr21?.expr22 || 'fallback'} ">
23+ {expr2?.expr21?.expr22 ?? 'nullish fallback'}
24+ </ div >
25+
26+ < p data-array ="{expr3.map(item => item.expr33).join(', ')} ">
27+ {expr3.length > 0 ? `Array length: ${expr3.length}` : 'Empty array'}
28+ </ p >
29+
30+ < div class ="{expr1() === 'bar' ? 'matched' : 'not-matched'} ">
31+ {expr1() === 'bar' ? 'String comparison works!' : 'String comparison failed'}
32+ </ div >
1133</ template >
You can’t perform that action at this time.
0 commit comments