Skip to content

Commit 29980e0

Browse files
committed
Fix stop problem.
1 parent d6cd11f commit 29980e0

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/components/CircularCountDownTimer.vue

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default {
5151
},
5252
stopValue: { // { '1': 0, '2': 1 }
5353
type: Object,
54-
required: true
54+
default: () => ({})
5555
},
5656
triggerUpdate: {
5757
type: Boolean,
@@ -143,14 +143,18 @@ export default {
143143
}
144144
},
145145
shouldStop () {
146-
let stop = true;
147-
for (const id in this.stopValue) {
148-
if (this.values[id].value !== this.stopValue[id]) {
149-
stop = false;
150-
break;
146+
if (Object.keys(this.stopValue) > 0) {
147+
let stop = true;
148+
for (const id in this.stopValue) {
149+
if (this.values[id].value !== this.stopValue[id]) {
150+
stop = false;
151+
break;
152+
}
151153
}
154+
return stop;
155+
} else {
156+
return false;
152157
}
153-
return stop;
154158
},
155159
notifyUpdateValues () {
156160
if (this.triggerUpdate) {

0 commit comments

Comments
 (0)