我目前正在try 建立一个图书Collection ,并try 了用循环展开动画制作通知图标.我正在使用Vue 3和Vutify,并且在一个带有行/列的网格中有多张卡.

我目前的问题是,动画在到达卡/栏边界时会被切断. 所以我想让动画越过边界.

Book

<template>
  <v-card class="rounded-0 test" width="300px">
    <v-img
      :src="img"
      gradient="to bottom, rgba(0,0,0,.1), rgba(0,0,0,.8)"
      cover
    >
      <v-container class="fill-height" fluid>
        <v-row v-if="newestVols" class="align-self-start full-width">
          <v-spacer></v-spacer>
          <v-col cols="3">
            <v-btn
              class="icon info-icon"
              variant="plain"
              color="red"
              icon="mdi-exclamation-thick"
              :ripple="false"
            >
            </v-btn>
          </v-col>
        </v-row>
        <v-row class="align-self-end full-width">
          <v-col cols="12">
            <v-card-title
              class="text-white pointer"
              @click="dialog = true"
              style="cursor: pointer"
            >
              {{ title }}

              <v-dialog v-model="dialog" width="auto">
                <v-card>
                  <v-container fluid>
                    <v-row justify="center">
                      <v-col
                        v-for="vol in sortedArray"
                        :key="vol.id"
                        class="d-flex justify-center fill-height"
                      >
                        <BookCard
                          :title="title"
                          :cover="vol.cover"
                          :number="vol.number"
                          :id="vol.id"
                          :editionID="id"
                          :showRemoveButton="true"
                        />
                      </v-col>
                    </v-row>
                  </v-container>
                  <v-card-actions>
                    <v-btn color="primary" block @click="dialog = false"
                      >Close Dialog</v-btn
                    >
                  </v-card-actions>
                </v-card>
              </v-dialog>
            </v-card-title>
          </v-col>
        </v-row>
      </v-container>
    </v-img>
  </v-card>
</template>

<script>
import BookCard from "./BookCard.vue";

export default {
  props: {
    img: {
      type: String,
    },
    title: {
      type: String,
    },
    volumes: {
      type: Array,
      default: [],
    },
    id: {
      type: Number,
    },
    volumes: {
      type: Array,
      default: [],
    },
  },
  components: {
    BookCard,
  },
  data: () => ({
    dialog: false,
  }),
  computed: {
    sortedArray() {
      return this.volumes.sort((a, b) => (a.number > b.number ? -1 : 1));
    },
    newestVols() {
      return ["test"];
    },
  },
};
</script>

<style>
.icon {
  font-size: 30px !important;
  opacity: 1 !important;
}

.full-width {
  width: 100%;
}

.pointer {
  cursor: pointer;
}

.info-icon i {
  animation: pulse 2s ease-out infinite;
  border-radius: 50% !important;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0px rgb(255, 0, 0, 1), 0 0 0 0px rgba(255, 44, 44, 0.85);
  }
  100% {
    box-shadow: 0 0 0 15px rgba(255, 0, 0, 0), 0 0 0 30px rgba(255, 44, 44, 0);
  }
}
</style>

推荐答案

在vCard和VIMG上有一条overflow: hidden规则,你必须绕过它.其中一种方法是通过Vutify的overflow-visible课程:

  <v-card class="rounded-0 test overflow-visible" width="300px">
    <v-img
      :src="img"
      gradient="to bottom, rgba(0,0,0,.1), rgba(0,0,0,.8)"
      cover
      class="overflow-visible"
    >
      ...

看看这playground个人

Css相关问答推荐

视频嵌入在Bootstrap 5轮播中没有响应扩展

寻找组件中最大的元素来设置其他组件的高度

靴子,为什么我不能让任何东西正确地排好队?

使用 CSS 定位悬停/弹出 div - 字形浏览器网页

设置初始大小并记住分配的最后大小

我可以拆分我的 CSS / SASS webpack 加载器规则,还是它们需要成为一个大规则?

通过 CSS 中的媒体查询更改站点的页面大小

Vue.js 变量中的动态类变量

条件宽度和省略号不适用于样式化组件 - React.js

图像 3D 悬停效果

CSS类和id同名

如何倾斜元素但保持文本正常(未倾斜)

CSS:背景图像和填充

如何将 textarea 宽度扩展到父级宽度的 100%(或如何将任何 HTML 元素扩展到父级宽度的 100%)?

CSS:将背景图像拉伸到屏幕的 100% 宽度和高度?

如何在 CSS 中覆盖图像?

通过 JavaScript 更改 CSS 伪元素样式

使用没有设置宽度或高度的边界半径的胶囊形状?

将 webkit 滚动条样式应用于指定元素

仅针对使用的类优化 Font Awesome