<template>
<swiper class="videoPlay" vertical :current="current" @change="change">
<swiper-item v-for="item in videos" :key="item">
<video :src="item" :controls="false" muted :class="[item]"></video>
</swiper-item>
</swiper>
<video id="videoPlayer"></video>
</template>
<script setup lang="ts">
const videos = ["https://xxxxx/1.mp4", "https://xxxxxx/2.mp4"];
const current = ref(0);
const change = (e: Event) => {
console.log(e);
};
</script>
代码如上图,测试会报错,报错信息为:类型 (e: Event) => void 不可分配给类型 EventHandle ,可是EventHandle 不知道从哪里导入,求大佬指点一下
g***@qq.com (作者)
感谢您的回复,但我是使用cli创建的项目基于vite,ts,vue3,我不知道如何引入SwiperChangeEvent
2023-07-06 16:05