diff --git a/src/views/project/form/ProjectTestPaperFormationStrategy.vue b/src/views/project/form/ProjectTestPaperFormationStrategy.vue index a25ef62..aabe488 100644 --- a/src/views/project/form/ProjectTestPaperFormationStrategy.vue +++ b/src/views/project/form/ProjectTestPaperFormationStrategy.vue @@ -140,15 +140,18 @@ export default { computed: {}, // 监控data中的数据变化 watch: { - tableData: function() { - let sum = 0 - this.tableData.forEach(element => { - if (element.totalScore) { - console.log('单条总分数', element.totalScore) - sum = sum + element.totalScore - } - }) - this.form.totalScore = sum + tableData: { + deep: true, + handler: function() { + let sum = 0 + this.tableData.forEach(element => { + if (element.totalScore) { + console.log('单条总分数', element.totalScore) + sum = sum + element.totalScore + } + }) + this.form.totalScore = sum + } } }, // 方法集合 @@ -181,7 +184,6 @@ export default { if (t1.topicType === t2.topicType) { this.$set(this.tableData[t1Index], 'topicNum', t2.topicNum) this.$set(this.tableData[t1Index], 'topicScore', t2.topicScore) - } }) })