在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ element table 表頭怎樣進(jìn)行合并

element table 表頭怎樣進(jìn)行合并

clipboard.png

讓 入住日期與離開日期兩列的數(shù)據(jù)處理后合并成一列

回答
編輯回答
失魂人

使用vue的插槽,代碼如下

<el-table-column prop="date" label="預(yù)定日期">
    <template slot-scope="scope">
        <span>{{scope.row.checkInDate}} ~ {{scope.row.checkOutDate}}</span>
    </template>
</el-table-column>

如果日期格式希望自定義,可以加上vue過濾器來格式化日期。示例代碼:

    {{scope.row.checkInDate | formatDate}}
2017年10月20日 09:26
編輯回答
黑與白

根據(jù)alsowen回答,貼一下我的代碼

<el-table-column 
      label="預(yù)訂日期"
       width="120"
       align='center'>
    <template slot-scope="scope">
      <span>{{scope.row.checkin_date | joinDate}} ~ {{scope.row.checkout_date | joinDate}}</span>
    </template>
</el-table-column>

clipboard.png

2018年6月20日 22:16