css 列表划过缩放动画

javascript 复制代码
<template>
  <div>
    <div class="item" v-for="(item,index) in list" :key="index">
      <img src="../../../../aa.png" alt="">
      <div class="num">{{(index+1) < 10 ? '0'+(index+1) : index+1 }}</div>
      <div class="title">{{item}}</div>
      <div class="go"></div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      list: [
        '抽烟喝酒烫头,抽烟喝酒烫头,抽烟喝酒烫头,抽烟喝酒烫头',
        '抽烟喝酒烫头,抽烟喝酒烫头,抽烟喝酒烫头,抽烟喝酒烫头',
        '抽烟喝酒烫头,抽烟喝酒烫头,抽烟喝酒烫头,抽烟喝酒烫头',
        '抽烟喝酒烫头,抽烟喝酒烫头,抽烟喝酒烫头,抽烟喝酒烫头',
        '抽烟喝酒烫头,抽烟喝酒烫头,抽烟喝酒烫头,抽烟喝酒烫头'
      ]
    }
  }
}
</script>

<style lang="less" scoped>
.item {
  display: flex;
  align-items: center;
  background: #ffffff;
  box-shadow: 0px 2px 4px 0px rgba(0, 70, 139, 0.04);
  border-radius: 4px;
  transition: all 0.5s;
  padding: 20px;
  box-sizing: border-box;
  margin-top: 20px;
  position: relative;
  img {
    width: 58px;
    height: 58px;
    border-radius: 50%;
  }
  .num {
    margin: 0 20px;
  }
  .go {
    position: absolute;
    right: 20px;
    top: 50%;
    background: url('../../static/images/icon1.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 100% 100%;
    width: 36px;
    height: 36px;
    transform: translate(0, -50%);
  }
  cursor: pointer;
  &:hover {
    transform: scale(1.02);
    box-shadow: 0px 2px 8px 4px rgba(0, 70, 139, 0.04);
    color: #004ca1;
    .go {
      background: url('../../static/images/icon1-hover.png');
      background-repeat: no-repeat;
      background-position: center center;
      background-size: 100% 100%;
      width: 36px;
      height: 36px;
      position: absolute;
      top: 50%;
      right: 20px;
      transform: translate(0, -50%);
    }
  }
}
</style>
相关推荐
低保和光头哪个先来4 分钟前
如何实现弹窗的 双击关闭 & 拖动 & 图层优先级
前端·javascript·css·vue.js
必然秃头12 分钟前
前端面试题总结
前端
布列瑟农的星空1 小时前
近一年前端招人面试感悟
前端·面试
mapbar_front1 小时前
从技术到基层管理的跃升
前端·程序员
xuehuayu.cn1 小时前
Chrome 命令行参数生成器
前端·chrome
Eiceblue1 小时前
React 前端实现 Word(Doc/Docx)转 HTML
前端·react.js·word
FogLetter1 小时前
大文件上传?我用分片上传+断点续传彻底解决了!
前端·javascript
前端大神之路1 小时前
vue2 虚拟dom
前端
Qinana1 小时前
🌟ES6 字符串模板与数组 map 的优雅实践
前端·javascript·程序员
残冬醉离殇2 小时前
深入理解浏览器事件系统:从用户点击到事件对象的完整旅程
前端·javascript