File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -40,12 +40,11 @@ export default {
40
40
41
41
watch: {
42
42
flipped (newValue ) {
43
+ const newDisplayValue = this .displayedValue == this .question ? this .answer : this .question
43
44
this .gotFlipped = false ;
44
45
new Promise ((resolve ) => setTimeout (resolve, 150 )).then (
45
46
() =>
46
- (this .displayedValue = newValue
47
- ? this .answer
48
- : this .question )
47
+ (this .displayedValue = newDisplayValue)
49
48
);
50
49
new Promise ((resolve ) => setTimeout (resolve, 320 )).then (
51
50
() => (this .gotFlipped = true )
@@ -54,6 +53,7 @@ export default {
54
53
55
54
answer (newAnswer ) {
56
55
this .displayedValue = newAnswer;
56
+
57
57
},
58
58
59
59
question (newQuestion ) {
Original file line number Diff line number Diff line change @@ -56,6 +56,12 @@ export default {
56
56
if (event .code === " Space" ) {
57
57
this .showAnswer = ! this .showAnswer ;
58
58
}
59
+ else if (event .code == " Digit1" ){
60
+ this .repeat ();
61
+ } else if (event .code == " Digit2" ){
62
+ this .completed ();
63
+ }
64
+ console .log (event .code )
59
65
},
60
66
61
67
repeat () {
You can’t perform that action at this time.
0 commit comments