原生js代码,不依赖任何库
npm i time-flop -P
import flop from 'time-flop';
flop({
format: 'hh mm ss',
size: 'small'
})(document.getElementById('timer'))
import flop from 'time-flop';
flop({
format: 'hhhh mm ss',
timeType: 'countdown',
deadline: new Date('2018-12-13 00:00:00')
})(document.getElementById('countdown'))