質問編集履歴

2

記述漏れ

2020/04/10 12:29

投稿

wasi300
wasi300

スコア66

test CHANGED
File without changes
test CHANGED
@@ -208,6 +208,8 @@
208
208
 
209
209
  let row = e.target.parentNode.parentNode.getAttribute('data-row');
210
210
 
211
+        let name = e.target.getAttribute('name');
212
+
211
213
  // this.estimate[row].ex1 = e.target.value; // このように自力で取得した値を入れるというやり方しかないでしょうか。
212
214
 
213
215
         this.$set(this.ex1[row],name,e.target.value); // setで値を入れる

1

一部解決したため

2020/04/10 12:28

投稿

wasi300
wasi300

スコア66

test CHANGED
File without changes
test CHANGED
@@ -152,6 +152,12 @@
152
152
 
153
153
 
154
154
 
155
+ 解決:組まないとダメ
156
+
157
+ データセットする時は$set()を使う
158
+
159
+
160
+
155
161
  ```vue
156
162
 
157
163
 
@@ -200,9 +206,11 @@
200
206
 
201
207
  calcMoney : function(e) {
202
208
 
203
- let row = e.target.parentNode.parentNode.getAttribute('data-row'); //parentNode2回使わない方法はないでしょうか。
209
+ let row = e.target.parentNode.parentNode.getAttribute('data-row');
204
-
210
+
205
- this.estimate[row].ex1 = e.target.value; // このように自力で取得した値を入れるというやり方しかないでしょうか。
211
+ // this.estimate[row].ex1 = e.target.value; // このように自力で取得した値を入れるというやり方しかないでしょうか。
212
+
213
+        this.$set(this.ex1[row],name,e.target.value); // setで値を入れる
206
214
 
207
215
  },}
208
216