Commit ffe4516f authored by 夏敏伟's avatar 夏敏伟

修改bug

parent fffdfaba
......@@ -10,8 +10,8 @@
<div class="content">
<div class="left-content">
<div class="leftModule bk-homeapge-animation" v-for="(item, index) in modules.leftModule">
<div :class="['module-info', isSelected == item.id ? ('selectedModule-left' + index) : '', 'left-div-' + index]"
@click="choiceModule(item.id)">
<div :class="['module-info', isSelected == index ? ('selectedModule-left' + index) : '', 'left-div-' + index]"
@click="choiceModuleLeft(index)">
<div class="info-description">
<div v-text="item.name"></div>
<div v-text="item.description"></div>
......@@ -34,8 +34,8 @@
</div>
<div class="right-content">
<div class="rightModule bk-homeapge-animation" v-for="(item, index) in modules.rightModule">
<div :class="['module-info', isSelected == item.id ? ('selectedModule-right' + index) : '', 'right-div-' + index]"
@click="choiceModule(item.id)">
<div :class="['module-info', isSelected == (index + 3) ? ('selectedModule-right' + index) : '', 'right-div-' + index]"
@click="choiceModuleRight(index)">
<div class="info-description">
<div v-text="item.name"></div>
<div v-text="item.description"></div>
......@@ -83,15 +83,26 @@ export default {
}
},
methods: {
choiceModule(id) {
choiceModuleLeft(index) {
let arr = this.query_selector('.leader-line');
if (arr.length > 0) {
arr.forEach(element => {
element.remove();
});
}
this.isSelected = id;
this.$store.commit("activeIndex", id - 1);
this.isSelected = index;
this.$store.commit("activeIndex", index);
this.$router.push("/");
},
choiceModuleRight(index) {
let arr = this.query_selector('.leader-line');
if (arr.length > 0) {
arr.forEach(element => {
element.remove();
});
}
this.isSelected = index + 3;
this.$store.commit("activeIndex", index + 3);
this.$router.push("/");
},
query_selector(selector) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment