1 2 3 4 5 6 7 8 9 10 11 12 | <van-grid :column-num= "2" class = "content" :border= "false" > <van-grid-item class = "box" v- for = "(item2,index2) in list" :key= "index2" > <div class = "inner-box" v- if = "!item2.isBack" @touchstart= "touchstartevent(item2,index2)" @touchmove= "touchmoveevent(item2,index2)" @touchend= "touchendevent(item2,index2)" > <span>正面</span> </div> <div class = "inner-box-back" @click.stop= "deleteModel(item2,index2)" v- else > <span>删除</span> </div> </van-grid-item> </van-grid> |
// 模板长按删除功能 touchstartevent(item,index){ this.closeDeleteevent()//清除删除图标事件 var self = this; this.timeoutEvent = 0; this.timeoutEvent = setTimeout(() => { self.enterLongevent(item,index);//长按执行的操作 },1000) }, enterLongevent(item,index){ item.isBack = true; console.log("长按了呀") }, touchmoveevent(item,index){ console.log("移动了") clearTimeout(this.timeoutEvent) this.timeoutEvent = 0; }, touchendevent(item,index){ console.log("离开屏幕") clearTimeout(this.timeoutEvent) this.timeoutEvent = 0; },
.inner-box{ width: 100%; border-radius: 10px; border: 1px solid #f2f2f2; -webkit-touch-callout: none!important; -webkit-user-select: none!important; -moz-user-select:none; -ms-uese-select:none; user-select: none; animation: mymoveone 0.5s ease-in-out; } @keyframes mymoveone{ from{ opacity: 0; transform: rotateY(90deg); } to{ opacity: 1; transform: rotateY(0); } } .inner-box-back{ width: 100%; height: 99px; animation: mymove 0.5s ease-in-out; border-radius: 10px; border: 1px solid #f2f2f2; background: fff; display: flex; flex-direction: column; justify-content: center; align-items: center; font-size: #333333; } @keyframes mymove{ from{ opacity: 0; transform: rotateY(-90deg); } to{ opacity: 1; transform: rotateY(0); } }
效果:
暂时无法显示
从啥也不会开始吧
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· AI与.NET技术实操系列(六):基于图像分类模型对图像进行分类