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

鍍金池/ 問答/HTML5  HTML/ vue的el-table怎么過濾綁定的數(shù)據(jù)

vue的el-table怎么過濾綁定的數(shù)據(jù)

<el-table-column prop="modifyTime" label="修改時(shí)間">
                </el-table-column>

想用下面自定義的過濾器 該怎么寫

//自定義過濾器過濾時(shí)間    作用:將1415674835697的時(shí)間戳轉(zhuǎn)為 yyyy/MM/dd 格式時(shí)間
Vue.filter("timeForm",function(time){
    time =(typeof time=='string')?parseInt(time) : time
    let date=new Date(time)
    return util.formateDate(date,'yyyy/MM/dd');
});

問題描述

問題出現(xiàn)的環(huán)境背景及自己嘗試過哪些方法

相關(guān)代碼

// 請(qǐng)把代碼文本粘貼到下方(請(qǐng)勿用圖片代替代碼)

你期待的結(jié)果是什么?實(shí)際看到的錯(cuò)誤信息又是什么?

回答
編輯回答
念初

<el-table-column prop="createDate" label="創(chuàng)建時(shí)間">

                <template slot-scope="scope">
                 {{scope.row.createDate|timeForm}}
               </template>
            </el-table-column>
2018年9月12日 09:49
編輯回答
別逞強(qiáng)
<el-table-column
            prop="date"
            label="發(fā)布時(shí)間">
            <template slot-scope="scope">
              {{$utils.toTimeFormat(scope.row.date)}}
            </template>
</el-table-column>
2018年5月15日 05:32