Vue中table合并单元格用法

<table>
    <tr>
        <th>地名th>
        <th>结果th>
        <th>人名th>
        <th>性别th>
    tr>
    <template v-for="(item, index) in list">
        <tr :key="index">
            <td :rowspan="item.groups.length">{{item.name}}td>
            <td :rowspan="item.groups.length" v-if="item.result === '1'">
            <span>已完成span>
       td>
            <td :rowspan="item.groups.length" v-if="item.result === '0' || item.result === null">
                <span>未完成span>
            td> 
            <td>{{item.groups[0].name}}td>
            <td>{{item.groups[0].sex}}td>
        tr>
        <tr v-for="(son, index) in item.groups.length - 1" :key="index">
            <td>{{item.groups[son].name}}td>
            <td>{{item.groups[son].sex}}td>
        tr>
    template>
table>

 

转载于:https://www.cnblogs.com/minozMin/p/9789987.html

你可能感兴趣的:(javascript,ViewUI)