質問編集履歴

1

回答を参考にして修正

2020/10/30 14:55

投稿

fresh_fish
fresh_fish

スコア20

test CHANGED
File without changes
test CHANGED
@@ -61,3 +61,57 @@
61
61
  </div>
62
62
 
63
63
  ```
64
+
65
+ ### 修正後
66
+
67
+ ```ここに言語を入力
68
+
69
+ let man
70
+
71
+ if (this.props.user.gender == 0) {
72
+
73
+ man = true;
74
+
75
+ } else {
76
+
77
+ man = false;
78
+
79
+ }
80
+
81
+
82
+
83
+ let woman
84
+
85
+ if (this.props.user.gender == 1) {
86
+
87
+ woman = true;
88
+
89
+ } else {
90
+
91
+ woman = false;
92
+
93
+ }
94
+
95
+
96
+
97
+   <div class="topandbottom5px">
98
+
99
+ <div class="radio">
100
+
101
+ <label htmlFor="user_gender_0">
102
+
103
+ <input type="radio" value="0" name="user[gender]" checked={man} id="user_gender_0" />
104
+
105
+ 男</label></div>
106
+
107
+ <div class="radio">
108
+
109
+ <label htmlFor="user_gender_1">
110
+
111
+ <input type="radio" value="1" name="user[gender]" checked={woman} id="user_gender_1" />
112
+
113
+ 女</label></div>
114
+
115
+ </div>
116
+
117
+ ```