mo 3 år sedan
förälder
incheckning
e7570cef89
2 ändrade filer med 32 tillägg och 10 borttagningar
  1. 13 0
      src/components/albumItem/index.module.less
  2. 19 10
      src/components/albumItem/index.tsx

+ 13 - 0
src/components/albumItem/index.module.less

@@ -1,4 +1,12 @@
 .itemWrap {
+  &:hover {
+    .hold {
+      img {
+        transform:scale(1.1);
+      }
+
+    }
+  }
   cursor: pointer;
   &:nth-child(5n){
     margin-right: 0;
@@ -20,6 +28,11 @@
     width: 219px;
     height: 219px;
     border-radius: 4px;
+    overflow: hidden;
+    transition: 2s;
+    img {
+      width: 100%;
+    }
   }
   span {
     color: #999;

+ 19 - 10
src/components/albumItem/index.tsx

@@ -1,4 +1,4 @@
-import { defineComponent, toRefs, reactive, onMounted, ref,watch } from 'vue'
+import { defineComponent, toRefs, reactive, onMounted, ref, watch } from 'vue'
 
 import classes from './index.module.less'
 import hold from './images/hold.png'
@@ -43,18 +43,27 @@ export default defineComponent({
       }
     )
     const router = useRouter()
-    const gotoAlbum = ()=>{
-
-      router.push({path:'/albumDetail',query:{id:state.detail.id}})
+    const gotoAlbum = () => {
+      router.push({ path: '/albumDetail', query: { id: state.detail.id } })
     }
     return () => (
       <>
-        <div class={classes.itemWrap} onClick={()=>{gotoAlbum()}}>
-          <img
-            src={state.detail.albumCoverUrl ? state.detail.albumCoverUrl : hold}
-            alt=""
-            class={classes.hold}
-          />
+        <div
+          class={classes.itemWrap}
+          onClick={() => {
+            gotoAlbum()
+          }}
+        >
+          <div   class={classes.hold}>
+            <img
+              src={
+                state.detail.albumCoverUrl ? state.detail.albumCoverUrl : hold
+              }
+              alt=""
+
+            />
+          </div>
+
           <h2>{state.detail.albumName}</h2>
           <div class={classes.itemBottom}>
             <div class={classes.itemBottomL}>