質問編集履歴
1
コメント修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
```vue
|
15
15
|
<template>
|
16
16
|
<table>
|
17
|
-
<template v-for="(item, idx) in list"> ← 1回目のループ
|
17
|
+
<template v-for="(item, idx) in list"> <!-- ← 1回目のループ -->
|
18
18
|
<tr>
|
19
19
|
<td>{{ item.moneyA }}</td>
|
20
20
|
<td>{{ item.moneyB }}</td>
|
@@ -38,20 +38,20 @@
|
|
38
38
|
export default {
|
39
39
|
data () {
|
40
40
|
return {
|
41
|
-
list: [], ← 後でajaxで値が入ります
|
41
|
+
list: [], // ← 後でajaxで値が入ります
|
42
42
|
}
|
43
43
|
},
|
44
44
|
computed: {
|
45
45
|
totalMoneyA() {
|
46
46
|
let sum = 0;
|
47
|
-
for (const item of this.list) { ← 2回目のループ
|
47
|
+
for (const item of this.list) { // ← 2回目のループ
|
48
48
|
sum += Number(item.moneyA);
|
49
49
|
}
|
50
50
|
return sum;
|
51
51
|
},
|
52
52
|
totalMoneyB() {
|
53
53
|
let sum = 0;
|
54
|
-
for (const item of this.list) { ← 3回目のループ
|
54
|
+
for (const item of this.list) { // ← 3回目のループ
|
55
55
|
sum += Number(item.moneyB);
|
56
56
|
}
|
57
57
|
return sum;
|