将链接添加到特定行

问题描述 投票:0回答:1

我正在尝试将图像添加到特定行。我尝试将大量图像添加到表中,并且此Google图像不断弹出而不是一行弹出。我有一段代码,我在其中添加图像和每一行的参数。我试图通过做{{link.img}}来添加图像,例如网站,URL和描述,但这也不起作用。下面是该代码的片段,其中包含所打印内容的屏幕快照。我想尽可能使{{link.img}}工作,以便与所有其他参数保持一致,但是如果不可行,那就很好。任何帮助将不胜感激。谢谢

image of table

LINKS = [
    {
        'id': uuid.uuid4().hex,
        'img': "../assets/ipts.png",
    },
    {
        'id': uuid.uuid4().hex,
        'img': "../assets/express.png",
    }
]


<table class="table table-hover">
          <thead>
            <tr>
              <th scope="col"></th>
              <th scope="col">Website</th>
              <th scope="col">URL</th>
              <th scope="col">Description</th>
              <th></th>
            </tr>
          </thead>
          <tbody>
            <tr v-for="(link, index) in links" :key="index">
              <!--<td>{{ link.img }}</td>-->
              <td>
                  <img v-bind:src="link.img" width="21" height="21">
                  <img src = "../assets/google-logo.png" width="21" height="21">
              </td>
              <!--<td><a href="{ link.URL }">{{ link.website }} </a></td>-->
              <td>{{ link.website }}</td>
              <td>{{ link.URL }}</td>
              <td>{{ link.description }}</td>
              <td></td>
            </tr>
          </tbody>
</table>
html vue.js
1个回答
-1
投票

如下使用没有qoute标记的对象数据键:

'id'=> id和........

links = [
    {
        id: uuid.uuid4().hex,
        img: "../assets/ipts.png",
    },
    {
        id: uuid.uuid4().hex,
        img: "../assets/express.png",
    }
]
© www.soinside.com 2019 - 2024. All rights reserved.