您还需要在下面的选择器中加入tr,
@Component({ selector: 'tr[my-component]', template: ` <td>{{data1.prop1}}</td> <td>{{data1.prop2}}</td> <td>{{data2.prop1}}</td> `})export class MyComponent { @Input() data1; @Input() data2;}希望这可以帮助!!

您还需要在下面的选择器中加入tr,
@Component({ selector: 'tr[my-component]', template: ` <td>{{data1.prop1}}</td> <td>{{data1.prop2}}</td> <td>{{data2.prop1}}</td> `})export class MyComponent { @Input() data1; @Input() data2;}希望这可以帮助!!