<el-col :span="8"><div class="grid-content title-time"> {{date}}</div></el-col>
mounted(){
let _this = this;
this.timer = setInterval(() => {
_this.date =this.getTime();
}, 1000)
},
methods:{
getTime(){
var date1=new Date();
var year=date1.getFullYear();
var month=date1.getMonth()+1;
var day=date1.getDate();
var hours=date1.getHours();
var minutes=date1.getMinutes();
var seconds=date1.getSeconds();
return year+"年"+month+"月"+day+"日"+hours+":"+minutes+":"+seconds
}
},
beforeDestroy() {
if (this.timer) {
clearInterval(this.timer);
}
}