# add cur time with moment.js

This commit is contained in:
xianfuxing 2018-08-22 23:08:12 +08:00
parent 8538e02f0c
commit 43ece7e820
2 changed files with 5 additions and 1 deletions

View File

@ -47,6 +47,7 @@
"jsonlint": "1.6.3", "jsonlint": "1.6.3",
"jszip": "3.1.5", "jszip": "3.1.5",
"mockjs": "1.0.1-beta3", "mockjs": "1.0.1-beta3",
"moment": "^2.22.2",
"normalize.css": "7.0.0", "normalize.css": "7.0.0",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"screenfull": "3.3.2", "screenfull": "3.3.2",

View File

@ -47,6 +47,7 @@
</template> </template>
<script> <script>
import moment from 'moment'
export default { export default {
name: 'screen', name: 'screen',
props: { props: {
@ -63,7 +64,9 @@ export default {
}, },
computed: { computed: {
lastTime() { lastTime() {
return this.lastItem.calc_time.substr(0, 16).split('') const curTime = moment().format('YYYY-MM-DD HH:mm')
return curTime.split('')
// return this.lastItem.calc_time.substr(0, 16).split('')
}, },
lastCount() { lastCount() {
const count = this.lastItem.mosq_count const count = this.lastItem.mosq_count