统一组件不同引用及传值显示不同

     
   
 
 
          
            
          
        
        
          
            
          
        
   
    
  props: {
    showtime: String
  },
data(){
return{  
 efmobj: {
        endtime: moment().endOf('day'),
        starttime: moment().startOf('day')
      }
}
},
 mounted () {
    let that = this
    switch (this.showtime) {
      case 'hour':
        that.efmobj.starttime = moment().startOf('hour')
        that.efmobj.endtime = moment().startOf('hour').add(1, 'hour')
        break
      case 'day':
        that.efmobj.starttime = moment().startOf('day')
        that.efmobj.endtime = moment().endOf('day')
        break
      default:
        that.efmobj.starttime = moment().startOf('day')
        that.efmobj.endtime = moment().endOf('day')
    }

    this.getfactorydata()
  },

你可能感兴趣的:(统一组件不同引用及传值显示不同)