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

修改bug

parent fffdfaba
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
<div class="content"> <div class="content">
<div class="left-content"> <div class="left-content">
<div class="leftModule bk-homeapge-animation" v-for="(item, index) in modules.leftModule"> <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]" <div :class="['module-info', isSelected == index ? ('selectedModule-left' + index) : '', 'left-div-' + index]"
@click="choiceModule(item.id)"> @click="choiceModuleLeft(index)">
<div class="info-description"> <div class="info-description">
<div v-text="item.name"></div> <div v-text="item.name"></div>
<div v-text="item.description"></div> <div v-text="item.description"></div>
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
</div> </div>
<div class="right-content"> <div class="right-content">
<div class="rightModule bk-homeapge-animation" v-for="(item, index) in modules.rightModule"> <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]" <div :class="['module-info', isSelected == (index + 3) ? ('selectedModule-right' + index) : '', 'right-div-' + index]"
@click="choiceModule(item.id)"> @click="choiceModuleRight(index)">
<div class="info-description"> <div class="info-description">
<div v-text="item.name"></div> <div v-text="item.name"></div>
<div v-text="item.description"></div> <div v-text="item.description"></div>
...@@ -83,15 +83,26 @@ export default { ...@@ -83,15 +83,26 @@ export default {
} }
}, },
methods: { methods: {
choiceModule(id) { choiceModuleLeft(index) {
let arr = this.query_selector('.leader-line'); let arr = this.query_selector('.leader-line');
if (arr.length > 0) { if (arr.length > 0) {
arr.forEach(element => { arr.forEach(element => {
element.remove(); element.remove();
}); });
} }
this.isSelected = id; this.isSelected = index;
this.$store.commit("activeIndex", id - 1); 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("/"); this.$router.push("/");
}, },
query_selector(selector) { 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