[Vue warn]: Failed to resolve filter: parseTime

I want to format the returned timestamp type in the el-table of element-ui. Why did I report this error


your parseTime is a js function and cannot be directly used as filters. You need to declare it as filters before you can use it

...
filters: {
    parseTime: function () {
        ...
    }
}

try this line:

filters: {
    parseTime: parseTime
}

add this paragraph to the filters

filters: {
  parseTime(time, cFormat) {
    return parseTime(time, cFormat)
  }
}

author, have you solved it? How did you do that?

Menu