代码之家  ›  专栏  ›  技术社区  ›  Success Man

如何在卡片组中添加链接?

  •  3
  • Success Man  · 技术社区  · 6 年前

    https://bootstrap-vue.js.org/docs/components/card/#card-deck-groups

    脚本如下:

    <div>
        <b-card-group deck>
            <b-card title="Title"
                    img-src="https://picsum.photos/300/300/?image=41"
                    img-alt="Img"
                    img-top>
                <p class="card-text">
                    This is a wider card with supporting text below as a
                    natural lead-in to additional content. This content
                    is a little bit longer.
                </p>
                <div slot="footer">
                    <small class="text-muted">Last updated 3 mins ago</small>
                </div>
            </b-card>
            <b-card title="Title"
                    img-src="https://picsum.photos/300/300/?image=41"
                    img-alt="Img"
                    img-top>
                <p class="card-text">
                    This card has supporting text below as a natural lead-in
                    to additional content.
                </p>
                <div slot="footer">
                    <small class="text-muted">Last updated 3 mins ago</small>
                </div>
            </b-card>
            <b-card title="Title"
                    img-src="https://picsum.photos/300/300/?image=41"
                    img-alt="Img"
                    img-top>
                <p class="card-text">
                    This is a wider card with supporting text below as a natural
                    lead-in to additional content. This card has even longer content
                    than the first to show that equal height action.
                </p>
                <div slot="footer">
                    <small class="text-muted">Last updated 3 mins ago</small>
                </div>
            </b-card>
        </b-card-group>
    </div>
    

    我想在标题和图片中添加链接

    我该怎么做?

    1 回复  |  直到 6 年前
        1
  •  1
  •   Carol Skelly    6 年前

    必须从中删除title属性 b-card 就用一个 b-link 内部 b-card-body 相反。。。

    <b-card img-src="https://picsum.photos/300/300/?image=41"
        img-alt="Img"
        img-top
      >
      <b-card-body>
        <b-link to="/">
          Title
        </b-link>
        <p class="card-text">
           This is a wider card with supporting text below as a
           natural lead-in to additional content. This content
           is a little bit longer.
       </p>
      </b-card-body>
    </b-card>