質問編集履歴
1
コード追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,8 +6,228 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
+
仕様としてはチェックボックスが数種類あり、その値によってJSONを元にDOMを生成しております。
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
**■stateとmethod
|
14
|
+
|
15
|
+
**
|
16
|
+
|
9
17
|
```react
|
10
18
|
|
19
|
+
constructor(props) {
|
20
|
+
|
21
|
+
super(props);
|
22
|
+
|
23
|
+
this.state = {
|
24
|
+
|
25
|
+
location: 'front-end-engineer'
|
26
|
+
|
27
|
+
};
|
28
|
+
|
29
|
+
}
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
getDataLocation(e) {
|
34
|
+
|
35
|
+
this.setState({
|
36
|
+
|
37
|
+
location: e.currentTarget.dataset.location,
|
38
|
+
|
39
|
+
});
|
40
|
+
|
41
|
+
}
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
```
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
**■チェックボックス部分**
|
52
|
+
|
53
|
+
```react
|
54
|
+
|
55
|
+
<ul className="list">
|
56
|
+
|
57
|
+
<li className="list__item">
|
58
|
+
|
59
|
+
<span className="radio">
|
60
|
+
|
61
|
+
<label>
|
62
|
+
|
63
|
+
<input
|
64
|
+
|
65
|
+
type="radio"
|
66
|
+
|
67
|
+
name="radio"
|
68
|
+
|
69
|
+
defaultChecked
|
70
|
+
|
71
|
+
data-location="front-end-engineer"
|
72
|
+
|
73
|
+
onClick={e => this.getDataLocation(e)}
|
74
|
+
|
75
|
+
/>
|
76
|
+
|
77
|
+
<span className="radio__label">
|
78
|
+
|
79
|
+
フロントエンドエンジニア
|
80
|
+
|
81
|
+
</span>
|
82
|
+
|
83
|
+
</label>
|
84
|
+
|
85
|
+
</span>
|
86
|
+
|
87
|
+
</li>
|
88
|
+
|
89
|
+
<li className="list__item">
|
90
|
+
|
91
|
+
<span className="radio">
|
92
|
+
|
93
|
+
<label>
|
94
|
+
|
95
|
+
<input
|
96
|
+
|
97
|
+
type="radio"
|
98
|
+
|
99
|
+
name="radio"
|
100
|
+
|
101
|
+
data-location="designer"
|
102
|
+
|
103
|
+
onClick={e => this.getDataLocation(e)}
|
104
|
+
|
105
|
+
/>
|
106
|
+
|
107
|
+
<span className="radio__label">デザイナー</span>
|
108
|
+
|
109
|
+
</label>
|
110
|
+
|
111
|
+
</span>
|
112
|
+
|
113
|
+
</li>
|
114
|
+
|
115
|
+
<li className="list__item">
|
116
|
+
|
117
|
+
<span className="radio">
|
118
|
+
|
119
|
+
<label>
|
120
|
+
|
121
|
+
<input
|
122
|
+
|
123
|
+
type="radio"
|
124
|
+
|
125
|
+
name="radio"
|
126
|
+
|
127
|
+
data-location="writer"
|
128
|
+
|
129
|
+
onClick={e => this.getDataLocation(e)}
|
130
|
+
|
131
|
+
/>
|
132
|
+
|
133
|
+
<span className="radio__label">編集・ライター</span>
|
134
|
+
|
135
|
+
</label>
|
136
|
+
|
137
|
+
</span>
|
138
|
+
|
139
|
+
</li>
|
140
|
+
|
141
|
+
<li className="list__item">
|
142
|
+
|
143
|
+
<span className="radio">
|
144
|
+
|
145
|
+
<label>
|
146
|
+
|
147
|
+
<input
|
148
|
+
|
149
|
+
type="radio"
|
150
|
+
|
151
|
+
name="radio"
|
152
|
+
|
153
|
+
data-location="photographer"
|
154
|
+
|
155
|
+
onClick={e => this.getDataLocation(e)}
|
156
|
+
|
157
|
+
/>
|
158
|
+
|
159
|
+
<span className="radio__label">フォトグラファー</span>
|
160
|
+
|
161
|
+
</label>
|
162
|
+
|
163
|
+
</span>
|
164
|
+
|
165
|
+
</li>
|
166
|
+
|
167
|
+
<li className="list__item">
|
168
|
+
|
169
|
+
<span className="radio">
|
170
|
+
|
171
|
+
<label>
|
172
|
+
|
173
|
+
<input
|
174
|
+
|
175
|
+
type="radio"
|
176
|
+
|
177
|
+
name="radio"
|
178
|
+
|
179
|
+
data-location="human-resources"
|
180
|
+
|
181
|
+
onClick={e => this.getDataLocation(e)}
|
182
|
+
|
183
|
+
/>
|
184
|
+
|
185
|
+
<span className="radio__label">人事</span>
|
186
|
+
|
187
|
+
</label>
|
188
|
+
|
189
|
+
</span>
|
190
|
+
|
191
|
+
</li>
|
192
|
+
|
193
|
+
<li className="list__item">
|
194
|
+
|
195
|
+
<span className="radio">
|
196
|
+
|
197
|
+
<label>
|
198
|
+
|
199
|
+
<input
|
200
|
+
|
201
|
+
type="radio"
|
202
|
+
|
203
|
+
name="radio"
|
204
|
+
|
205
|
+
data-location="marketing"
|
206
|
+
|
207
|
+
onClick={e => this.getDataLocation(e)}
|
208
|
+
|
209
|
+
/>
|
210
|
+
|
211
|
+
<span className="radio__label">マーケティング</span>
|
212
|
+
|
213
|
+
</label>
|
214
|
+
|
215
|
+
</span>
|
216
|
+
|
217
|
+
</li>
|
218
|
+
|
219
|
+
</ul>
|
220
|
+
|
221
|
+
```
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
**■メインコンテンツ部分**
|
228
|
+
|
229
|
+
```react
|
230
|
+
|
11
231
|
<ul className="user-list">
|
12
232
|
|
13
233
|
{Object.keys(userListJson[location]).map((item, index) => {
|