diff --git a/src/components/martixCraft/Edit/index.vue b/src/components/martixCraft/Edit/index.vue index 4dc7c06..2205141 100644 --- a/src/components/martixCraft/Edit/index.vue +++ b/src/components/martixCraft/Edit/index.vue @@ -348,10 +348,10 @@ const tabChangeHandle = () => { } } - :deep(.swiper-pagination-bullet) { - width: 20px; - height: 20px; - } +:deep(.swiper-pagination-bullet) { + width: 20px; + height: 20px; +} .el-select { width: 70%; margin: 0 30px; diff --git a/src/components/spray/sprayParams/index.vue b/src/components/spray/sprayParams/index.vue index 36d5594..f1052be 100644 --- a/src/components/spray/sprayParams/index.vue +++ b/src/components/spray/sprayParams/index.vue @@ -12,7 +12,12 @@ import FtDialog from 'components/common/FTDialog/index.vue' import TrayGraph from 'components/spray/trayGraph/index.vue' import { FtMessage } from 'libs/message' import { cloneDeep } from 'lodash' +import { Navigation, Pagination } from 'swiper/modules' +import { Swiper, SwiperSlide } from 'swiper/vue' import { nextTick, onMounted, ref } from 'vue' +import 'swiper/css' +import 'swiper/css/pagination' +import 'swiper/css/navigation' const props = defineProps({ formData: { @@ -159,6 +164,11 @@ const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' | } form.value.times.splice(activeTab.value, 1) } + swiperInstance?.slideTo(activeTab.value) + // 异步任务调用 + setTimeout(() => { + swiperInstance?.update() + }, 100) } const matrixCraftChange = async (id: number) => { @@ -172,6 +182,19 @@ const matrixCraftChange = async (id: number) => { loading.value = false }) } + +const onSlideChange = (swiper: any) => { + activeTab.value = swiper.activeIndex +} + +let swiperInstance: any = null +const onSwiperInitialized = (swiper: any) => { + swiperInstance = swiper +} + +const tabChangeHandle = () => { + swiperInstance?.slideTo(activeTab.value) +}