在控制台日志中,我有15:14
,但在模板中,我有12:14
. 为什么?
<template>
<span>{{ date }}</span> <!-- **expected** Thu, 25 Feb 2021 15:14:04 Thu, **got** 25 Feb 2021 12:14:04 GMT -->
</template>
<script>
export default {
computed: {
date() {
const date = getStatusDate(); // returns string 2021-02-25 15:14:04
return dayjs(date, 'YYYY-MM-DD HH:mm:ss+z')
}
}
}
</script>