css - Vue3 @click deos 在使用 -webkit-perspective: 500px 样式的元素内不起作用
问题描述
我要创建的是 3d Carousel,但是当我添加透视 500px vue click 不起作用。我的代码看起来像这样......
<div class="wrapper">
<div class="stage">
<div class="h-full w-full" v-for="image in images" :key="image.id" :class="{'hidden box h-full rounded-2xl':true, 'active':active==image.id, 'previous': pre==image.id, 'next': image.id==next}">
<img :src="image.url" @click="setActive(image.id)" class="h-full rounded-2xl shadow-xl w-full" alt="">
</div>
</div>
</div>
和 CSS
.wrapper{
background-image: url("../assets/carousel/bg.jpg");
background-size: cover;
height: 100%;
width: 100%;
display: flex;
overflow: hidden;
justify-content: center;
justify-items: center;
justify-self: center;
align-items: center;
-webkit-perspective: 500px;
-webkit-perspective-origin: center;
}
.stage{
-webkit-transform-style: preserve-3d;
display: flex;
flex-direction: row;
align-items: center;
height: 100%;
width: 100%;
position: relative;
}
.box{
position: absolute;
height: 100%;
}
当我删除透视图时它工作正常,但我尝试实现 3d 轮播,有什么建议吗?
解决方案
推荐阅读
- php - adobe echosine :create webhook from api 给出了 INVALID_API_ACCESS_POINT 的响应
- javascript - JS:如何从base64创建图像类型的文件
- java - 我正在获取 MySQL 服务器版本,以便在“.null”附近使用正确的语法
- android - 由于缺少 JAR 签名,Android Studio 不允许我上传 APK
- ember.js - 尝试将 Ember 2.14.2 更新到 Ember 2.18.2 时出错
- web-services - 如何在短时间内从 GAE 服务轮询 Web 服务?
- c# - 使用数据行测试是否可以在构建时对 TestCategory 进行过滤?
- flutter - 颤振行将一项放在开始,另一项放在中间
- java - 波纹效果在 Android 9(Api 28,Pie)上无法正常工作
- sql-server - SQL Server:字符串连接句柄