最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Remove the clicking effect from a vuetify's v-card when it has a link associated to it - Stack Overflow

programmeradmin2浏览0评论

I have a list of v-cards, all of which have the to prop set to something. When I click on it, the default behaviour is to have the clicked effect, which I do not want. How do I remove it?

The code looks looks something like this:

<v-col v-for="item in myItems" :key="`${item.id}`" cols="12">
  <v-card :key="item.id" class="pl-4 pr-4" :to="item.href">
    <div class="some-unrelated-class">
      <p>{{item.name}}</p>
    </div>
  </v-card>
</v-col>

Here are some images of what I am talking about:

When I am clicking on one of these items, the following appears:

If I let go of the click, elsewhere on the screen so that I don't visit the link it stays like this:

I want both of those effects removed and for the item to just stay the white.

I've tried playing a bit around with the styles but to no avail and can't seem to find the source of the color change.

// Example (but doesnt work)
.v-card--link:active {
    background-color: white !important;
}

Anyway, how can I remove these extra decorations on a v-card ponent when it is to be used as link?

I have a list of v-cards, all of which have the to prop set to something. When I click on it, the default behaviour is to have the clicked effect, which I do not want. How do I remove it?

The code looks looks something like this:

<v-col v-for="item in myItems" :key="`${item.id}`" cols="12">
  <v-card :key="item.id" class="pl-4 pr-4" :to="item.href">
    <div class="some-unrelated-class">
      <p>{{item.name}}</p>
    </div>
  </v-card>
</v-col>

Here are some images of what I am talking about:

When I am clicking on one of these items, the following appears:

If I let go of the click, elsewhere on the screen so that I don't visit the link it stays like this:

I want both of those effects removed and for the item to just stay the white.

I've tried playing a bit around with the styles but to no avail and can't seem to find the source of the color change.

// Example (but doesnt work)
.v-card--link:active {
    background-color: white !important;
}

Anyway, how can I remove these extra decorations on a v-card ponent when it is to be used as link?

Share Improve this question asked Jan 27, 2021 at 15:13 theJulstheJuls 7,49019 gold badges96 silver badges182 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

If you want to remove the animation the occurs when you click on the v-card you can do it by adding:

:ripple="false"

to your v-card tag, you can read more about ripple directive here: https://vuetifyjs./en/directives/ripple/

EDIT: According to ments, it didn't remove gray background, you can add this to your CSS and it will remove the background as well

.v-card--link:before {
  background: none;
}

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论