Convert vue timestamp to time display

the time in the table data given by the background is a 13-bit timestamp, which needs to be converted into time to be displayed in the table.

// 
      timestampToTime (cjsj) {
        var date = new Date(cjsj) //10*1000131000
        var Y = date.getFullYear() + "-"
        var M = (date.getMonth()+1 < 10 ? "0"+(date.getMonth()+1) : date.getMonth()+1) + "-"
        var D = date.getDate() + " "
        var h = date.getHours() + ":"
        var m = date.getMinutes() + ":"
        var s = date.getSeconds()
        return Y+M+D+h+m+s
        console.log(timestampToTime (1533293827000))
    },

tell me how to call this method in the table in < template >. I didn"t get the time when I called it.
uses the table component < el-table-column > in the element-ui framework, where is the name of the field bound on prop. How to convert this timestamp and bind it to the table

May.22,2021

1, write a time processing function
2, Vue.filter in the global
3, in template

<el-table-column
                label=""
                with="300"
                :show-overflow-tooltip="true">
                <template slot-scope="scope">
                    <i class="el-icon-time"></i>
                    <span>{{ scope.row.last_login_time | timestampToTime('{y}-{m}-{d} {h}:{i}') }}</span>
                </template>
            </el-table-column>

<el-table-column label="" prop="cjsj" :formatter="timestampToTime" align="center">
</el-table-column>

use the formatter function included in the element-ui table to format the contents of the table

// 
// element tableformatter
      timestampToTime (row, column) {
        var date = new Date(row.cjsj) //10*1000131000
        var Y = date.getFullYear() + '-'
        var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-'
        var D = date.getDate() + ' '
        var h = date.getHours() + ':'
        var m = date.getMinutes() + ':'
        var s = date.getSeconds()
        return Y+M+D+h+m+s
        console.log(timestampToTime (1533293827000))
    },

two kinds:

 //1. {{}}     
{{timestampToTime(youtimestamp)}}

//2.

:propetyName="timestampToTime(youtimestamp)"
Menu