如何从 Vue 组件 return 多行?

How to return multiple rows from a Vue Component?

简而言之,我正在尝试在 VueJS (v2.5.17) 中做这样的事情:

<table>
  <my-multi-row-entry v-for="t in things" :thing="t" :key="t.id"/>
</table>

问题是每件事都由两个 <TR>...</TR> 条目表示。 (我正在移植别人的代码;第一行中的 table 数据跨越到第二行,等等,所以 现在 我想保留他们拥有的.)

显而易见的解决方案行不通,因为 VueJS 只需要将一个根元素发送到 DOM。

MyMultiRowEntry.vue (无效代码,但显示用于说明)

<template>
  <tr><td rowspan="2">{{ thing.foo }}</td><td>...</td><td>{{ thing.bar }}</td></tr>
  <tr><td>{{ thing.xyzzy }}</td></tr>
</template>

<script>
  export default {
    props: {
      thing: {
         type: Object,
         required: true
      }
    }
  };
</script>

我已经探索过的路径:

实现上述目的的最佳方法是什么?

在这个特定的示例中,我要做的只是简单地将多个 tr 包装到 tbody 容器中,如下所示:

MyMultiRowEntry.vue

<template>
  <tbody>
      <tr><td rowspan="2">{{ thing.foo }}</td><td>...</td><td>{{ thing.bar }}</td></tr>
      <tr><td>{{ thing.xyzzy }}</td></tr>
  </tbody>
</template>