-
Notifications
You must be signed in to change notification settings - Fork 439
Expand file tree
/
Copy pathexpression.js
More file actions
39 lines (34 loc) · 964 Bytes
/
expression.js
File metadata and controls
39 lines (34 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* Copyright (c) 2018, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: MIT
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
*/
import { LightningElement } from 'lwc';
export default class Sample extends LightningElement {
expr1() {
return 'bar';
}
expr2 = { expr21: { expr22: 'expr22' } };
expr3 = [{ expr33: 'expr33' }];
// Additional data for complex expression testing
get complexData() {
return {
string: 'test',
number: 42,
boolean: true,
array: [1, 2, 3, 4, 5],
nested: {
deep: {
value: 'nested value',
},
},
};
}
get computedValue() {
return this.expr1() + '_computed';
}
get conditionalValue() {
return this.expr2?.expr21?.expr22 ? 'hasValue' : 'noValue';
}
}