Artifact
96e00a93b6158a18a842395eaadaa2d88d08fde1482314a2eaafbdeca9314fc2:
0000: 3c 6c 6f 6f 70 2d 6f 70 74 67 72 6f 75 70 32 3e <loop-optgroup2>
0010: 0a 20 20 3c 73 65 6c 65 63 74 3e 0a 20 20 20 20 . <select>.
0020: 3c 6f 70 74 69 6f 6e 20 73 65 6c 65 63 74 65 64 <option selected
0030: 3d 22 7b 20 74 72 75 65 20 7d 22 3e 26 6c 74 3b ="{ true }"><
0040: 53 65 6c 65 63 74 20 4f 70 74 69 6f 6e 26 67 74 Select Option>
0050: 3b 0a 20 20 20 20 3c 6f 70 74 67 72 6f 75 70 20 ;. <optgroup
0060: 65 61 63 68 3d 22 7b 20 67 72 6f 75 70 20 69 6e each="{ group in
0070: 20 64 61 74 61 20 7d 22 20 6c 61 62 65 6c 3d 22 data }" label="
0080: 7b 20 67 72 6f 75 70 2e 6e 61 6d 65 20 7d 22 3e { group.name }">
0090: 0a 20 20 20 20 20 20 20 20 3c 6f 70 74 69 6f 6e . <option
00a0: 20 65 61 63 68 3d 22 7b 20 6f 70 74 69 6f 6e 20 each="{ option
00b0: 69 6e 20 67 72 6f 75 70 2e 6f 70 74 69 6f 6e 73 in group.options
00c0: 20 7d 22 20 76 61 6c 75 65 3d 22 7b 20 6f 70 74 }" value="{ opt
00d0: 69 6f 6e 2e 76 61 6c 75 65 20 7d 22 20 64 69 73 ion.value }" dis
00e0: 61 62 6c 65 64 3d 7b 20 6f 70 74 69 6f 6e 2e 64 abled={ option.d
00f0: 69 73 61 62 6c 65 64 20 7d 3e 7b 20 6f 70 74 69 isabled }>{ opti
0100: 6f 6e 2e 6e 61 6d 65 20 7d 0a 20 20 20 20 3c 2f on.name }. </
0110: 6f 70 74 67 72 6f 75 70 3e 0a 20 20 3c 2f 73 65 optgroup>. </se
0120: 6c 65 63 74 3e 0a 0a 20 20 74 68 69 73 2e 64 61 lect>.. this.da
0130: 74 61 20 3d 20 5b 0a 20 20 20 20 7b 0a 20 20 20 ta = [. {.
0140: 20 20 20 6e 61 6d 65 3a 20 27 47 72 6f 75 70 20 name: 'Group
0150: 31 27 2c 0a 20 20 20 20 20 20 6f 70 74 69 6f 6e 1',. option
0160: 73 3a 20 5b 20 7b 20 6e 61 6d 65 3a 20 27 4f 70 s: [ { name: 'Op
0170: 74 69 6f 6e 20 31 2e 31 27 2c 20 76 61 6c 75 65 tion 1.1', value
0180: 3a 20 31 2c 20 64 69 73 61 62 6c 65 64 3a 20 27 : 1, disabled: '
0190: 27 20 7d 2c 7b 20 6e 61 6d 65 3a 20 27 4f 70 74 ' },{ name: 'Opt
01a0: 69 6f 6e 20 31 2e 32 27 2c 20 76 61 6c 75 65 3a ion 1.2', value:
01b0: 20 32 2c 20 64 69 73 61 62 6c 65 64 3a 20 27 31 2, disabled: '1
01c0: 27 20 7d 20 5d 0a 20 20 20 20 7d 2c 0a 20 20 20 ' } ]. },.
01d0: 20 7b 0a 20 20 20 20 20 20 6e 61 6d 65 3a 20 27 {. name: '
01e0: 47 72 6f 75 70 20 32 27 2c 0a 20 20 20 20 20 20 Group 2',.
01f0: 6f 70 74 69 6f 6e 73 3a 20 5b 20 7b 20 6e 61 6d options: [ { nam
0200: 65 3a 20 27 4f 70 74 69 6f 6e 20 32 2e 31 27 2c e: 'Option 2.1',
0210: 20 76 61 6c 75 65 3a 20 33 2c 20 64 69 73 61 62 value: 3, disab
0220: 6c 65 64 3a 20 30 20 7d 2c 7b 20 6e 61 6d 65 3a led: 0 },{ name:
0230: 20 27 4f 70 74 69 6f 6e 20 32 2e 32 27 2c 20 76 'Option 2.2', v
0240: 61 6c 75 65 3a 20 34 2c 20 64 69 73 61 62 6c 65 alue: 4, disable
0250: 64 3a 20 74 72 75 65 20 7d 20 5d 0a 20 20 20 20 d: true } ].
0260: 7d 0a 20 20 5d 0a 3c 2f 6c 6f 6f 70 2d 6f 70 74 }. ].</loop-opt
0270: 67 72 6f 75 70 32 3e 0a group2>.