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>
相关推荐
橙序员小站1 小时前
Agent Skill 是什么?一文讲透 Agent Skill 的设计与实现
前端·后端
炫饭第一名3 小时前
速通Canvas指北🦮——基础入门篇
前端·javascript·程序员
王晓枫4 小时前
flutter接入三方库运行报错:Error running pod install
前端·flutter
符方昊4 小时前
React 19 对比 React 16 新特性解析
前端·react.js
ssshooter4 小时前
又被 Safari 差异坑了:textContent 拿到的值居然没换行?
前端
曲折4 小时前
Cesium-气象要素PNG色斑图叠加
前端·cesium
Forever7_4 小时前
Electron 淘汰!新的桌面端框架 更强大、更轻量化
前端·vue.js
不会敲代码14 小时前
前端组件化样式隔离实战:React CSS Modules、styled-components 与 Vue scoped 对比
css·vue.js·react.js
Angelial4 小时前
Vue3 嵌套路由 KeepAlive:动态缓存与反向配置方案
前端·vue.js
jiayu5 小时前
Angular学习笔记24:Angular 响应式表单 FormArray 与 FormGroup 相互嵌套
前端