How the vue countdown shows up as NAN on browsers in the ie kernel.

it can be displayed normally in other browsers, only the NAN in the ie kernel.
< template >

  <span>{{time}}</span>

< / template >

< script >
export default {
data () {

   return {
       time : "",
       flag : false
   }

},
mounted () {

let time = setInterval(()=>{
  if(this.flag == true){
    clearInterval(time)
  }
  this.timeDown()
 },500)

},
props: {

   endTime : {
       type : String
   }

},
methods: {

   timeDown () {
       const endTime = new Date(this.endTime)
       const nowTime = new Date();
       let leftTime = parseInt((endTime.getTime()-nowTime.getTime())/1000)
       let d = parseInt(leftTime/(24*60*60))
       let h = this.formate(parseInt(leftTime/(60*60)%24))
       let m = this.formate(parseInt(leftTime/60%60))
       let s = this.formate(parseInt(leftTime%60))
       if(leftTime <= 0){
           this.flag = true
           this.$emit("timeend")
       }
       this.time = `${d}${h}${m}${s}`
   },
   formate (time) {
       if(time>=10){
           return time
       }else{
           return `0${time}`
       }
   }

}
}
< / script >

above is the js of processing time

this is the time format returned by the background
"2018-08-08 09:13:14"

Mar.31,2021

add let _ this = this; to the first line of the timeDown function, and all the following this are replaced by _ this .


const endTime = new Date(this.endTime.replace(/-/g, '\/'))

const endTime= new Date (this.endTime) IE does not support this conversion
change to
const endTime= new Date (yyyy,MM,dd,hh,mm,ss)
to convert


ie does not support 2018-08-08 09:13:14 this format
supports 2018-08-08 09:13:14

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3bd0e-2c2d0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3bd0e-2c2d0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?