diff --git a/src/views/contest/contestDetail.vue b/src/views/contest/contestDetail.vue
index b05d5b2d6..5e3474b98 100644
--- a/src/views/contest/contestDetail.vue
+++ b/src/views/contest/contestDetail.vue
@@ -10,8 +10,9 @@
:highlight-current="false"
style="background-color: transparent;max-height: calc(100% - 54px);overflow-y: auto;"
:expand-on-click-node="false"
+ @node-click="handleClick"
>
-
+
@@ -109,7 +110,6 @@ export default {
this.nowKey = this.$route.query.nowKey || 0;
}
this.nowData = this.taskList[this.nowKey];
- // console.log(this.taskData, this.taskList, this.nowData, '===', data);
}).catch(() => this.$message.error('加载数据失败!'));
},
methods: {
@@ -121,10 +121,15 @@ export default {
}
});
},
- handleChange(data, node) {
- node.isCurrent = false;
- this.$set(node, 'isCurrent', false);
- this.nowData = data;
+ handleClick(data) {
+ const index = this.taskList.findIndex(ele => {
+ return ele.id === data.id;
+ });
+ if (index < 0) {
+ return;
+ }
+ this.nowKey = index;
+ this.nowData = this.taskList[this.nowKey];
},
eachTask(list, data) {
data.forEach(ele => {