<template> <div> {{ time | formatTime }} {{ status | getDicVal(statusDic) }} </div> </template>
statusDic: [
{ key: '1', value: '启用' },
{ key: '2', value: '停用' }
]
filters: {
formatTime (time) {
return time.slice(0, 4) + '-' + time.slice(4, 6) + '-' + time.slice(6, 8) + ' ' + time.slice(9, 17)
},
getDicVal: (key, dic) => dic.find(v => v.key === key).value
}