直接引入
import {number} from '@/utile/number'
然后直接在数字前加方法number(13165)
export const timess = () => {
var times = ''
var Y = new Date().getFullYear()
var M = new Date().getMonth()
var D = new Date().getDate()
var h = new Date().getHours()
var m = new Date().getMinutes()
var s = new Date().getSeconds()
const midules = (data: any) => {
if (data < 10) {
return '0' + data
} else {
return data
}
}
return times=times+midules(Y)+'-'+midules(M)+'-'+midules(D)+' '+midules(h)+':'+midules(m)+':'+midules(s)
}