路由器链接结合到B卡图像



是否可以将路由器链接绑定到B-Card的图像属性不存在物理,我想切换图像上的链接

 <b-col lg="3" v-for="product in products" v-bind:key="product.id">
     <b-card 
      v-bind:title="product.title"
      v-bind:img-src="product.img"
      v-bind:img-alt="product.alt"
      img-top
      tag="article"
      style="max-width: 20rem;"
      class="mb-2">
      <b-card-text>Some quick example text to build on the card title and 
       make up the bulk of the card's content.</b-card-text>
      </b-card>
   </b-col>

是否没有手动创建" IMG"标签的解决方案?

这是我找到的最好的解决方案

<b-card no-body
      v-bind:title="product.title" 
      v-bind:img-alt="product.alt"
      img-top
      tag="article"
      style="max-width: 20rem;"
      class="mb-2"
    >
    <router-link :to="/someurl">
    <b-card-img :src="product.img"/> 
    </router-link>
    <b-card-body>
       <b-card-title>CCCCCCCCc</b-card-title>
       <b-card-text>Some quick example text to build on the card title and make up 
         the 
        bulk of the card's content.</b-card-text>
      </b-card-body>
     </b-card>
   </b-col>

最新更新