vue.js - 如何制作可点击的带有悬停效果的q卡?

我们将 Quasar Framework 与 Vue.js 结合使用。考虑以下可点击的 q-card:

<div class="q-pa-md row items-start q-gutter-md cursor-pointer">
  <q-card class="my-card" clickable @click="GetSapRoster">
    <q-card-section class="bg-primary text-white">
      <div class="text-h6">SAP Truck Roster</div>
      <div class="text-subtitle2">Get the truck planning</div>
    </q-card-section>
  </q-card>
</div>

q-card 如何实现与 q-btn 相同的效果?

目前正在使用类 cursor-pointer它只修复鼠标指针,而不修复像 q-btn 那样的阴影效果。

最佳答案

您可以使用 v-ripple + q-hoverable + q-focus-helper 来模拟一个按钮。

例如:

<q-card v-ripple class="my-box cursor-pointer q-hoverable">
     <span class="q-focus-helper"></span>
     <q-card-section>
        ...
     </q-card-section>
</q-card>

https://stackoverflow.com/questions/64890882/

相关文章:

c - 打印函数,C语言的hello world

r - 使用向量和定义的标量在 R 中生成金字塔

c++ - 仅当使用 unordered_map 而不是 vector 时,将 const 作为此参

wordpress - Disqus iframe 透明度不适用于 Chrome 87

node.js - docker-compose npm install && npm start

python - Windows 上的 Gcloud 命令(使用 git bash)正在记录错误 :

react-native - React native 每次打开页面时如何执行函数

azure-devops - Azure Devops - Terraform 任务失败并出现错误

scala - scala中以下两种模式匹配案例有什么区别

python - 删除txt中的特定字符