Router-link 绑定到 b-card 图像
Router-link binding to b-card image
是否可以绑定router-link到b卡的image属性是
实际不存在,我想切换 link 图片点击
<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>
是否可以绑定router-link到b卡的image属性是 实际不存在,我想切换 link 图片点击
<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>