Commit b96bf7cf authored by wildfirecode13's avatar wildfirecode13

1

parent 1581a7ac
......@@ -7,7 +7,6 @@ const runTypeDoc = () => gulp
.pipe(typedoc({
out: './docs',
mode:'file',
// 这个文件里都是 export * from '...' 就没必要导出文档了
exclude: '**/*/index.ts',
tsconfig: 'tsconfig.json',
}))
......@@ -31,4 +30,5 @@ const watch = () => gulp.watch(
gulp.series(runTypeDoc, reload)
)
gulp.task('default', gulp.series(runTypeDoc, runBrowserSync, watch))
\ No newline at end of file
gulp.task('watch', gulp.series(runTypeDoc, runBrowserSync, watch))
gulp.task('build', gulp.series(runTypeDoc))
\ No newline at end of file
......@@ -6,8 +6,8 @@
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc",
"buildDoc": "jsdoc",
"watchDoc": "gulp",
"doc": "gulp build",
"watch": "gulp watch",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
......
import { EventEmitter } from "../event";
function getNum(n: any) {
function getTimeNum(n: any) {
return n >= 10 ? `${n}` : `0${n}`;
}
......@@ -31,14 +31,14 @@ export class Countdown extends EventEmitter<any> {
const hours = Math.floor(left / 3600);
const minutes = Math.floor((left % 3600) / 60);
const seconds = left - hours * 3600 - minutes * 60;
return `${getNum(hours)}:${getNum(minutes)}:${getNum(seconds)}`;
return `${getTimeNum(hours)}:${getTimeNum(minutes)}:${getTimeNum(seconds)}`;
}
private getMMSS() {
const left = this._seconds - this._counter;
const minutes = Math.floor(left / 60);
const seconds = left % 60;
return `${getNum(minutes)}:${getNum(seconds)}`;
return `${getTimeNum(minutes)}:${getTimeNum(seconds)}`;
}
private getText() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment