|
@@ -4,7 +4,7 @@
|
|
|
<div class="menu">
|
|
|
<swiper v-if="projectList.length" :slides-per-view="5" :space-between="0" :initialSlide="2" :loop="true"
|
|
|
:centeredSlides="true" :modules="[Navigation]" @swiper="onSwiper">
|
|
|
- <swiper-slide v-for="(item, index) in projectList " :key="index">
|
|
|
+ <swiper-slide v-for="(item, index) in projectList" :key="index" @click="getOption(item)">
|
|
|
<div class="li">
|
|
|
<div class="pic"><img :src="'static/images/train/' + item.key + '.png'"></div>
|
|
|
<div class="name">
|
|
@@ -14,6 +14,7 @@
|
|
|
</swiper-slide>
|
|
|
</swiper>
|
|
|
</div>
|
|
|
+ <OptionWindow ref="optionWindowRef" :projectList="projectList" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -25,7 +26,8 @@ import 'swiper/css';
|
|
|
import 'swiper/scss/navigation';
|
|
|
const router = useRouter();
|
|
|
const { proxy } = getCurrentInstance() as any;
|
|
|
-const mySwiper = ref(null);
|
|
|
+const optionWindowRef = ref();
|
|
|
+const mySwiper = ref();
|
|
|
const data = reactive<any>({
|
|
|
projectList: [],
|
|
|
timerManager: {},
|
|
@@ -55,6 +57,13 @@ const getInitExam = () => {
|
|
|
}, 5000)
|
|
|
};
|
|
|
|
|
|
+/**
|
|
|
+ * 弹出选项窗口
|
|
|
+*/
|
|
|
+const getOption = (data: any) => {
|
|
|
+ optionWindowRef.value.open(data);
|
|
|
+};
|
|
|
+
|
|
|
/**
|
|
|
* 获取项目
|
|
|
*/
|