5959 </v-card >
6060 </v-dialog >
6161
62+ <!-- reset dialog -->
63+ <v-dialog v-model =" resetDialog" width =" 500" >
64+ <v-card >
65+ <v-card-title class =" headline white--text red lighten-1" >
66+ ¿Estás seguro?
67+ </v-card-title >
68+
69+ <v-card-text class =" pt-5" >
70+ Se eliminarán los todos los resultados. Esta acción no se puede
71+ deshacer.
72+ </v-card-text >
73+
74+ <v-divider ></v-divider >
75+
76+ <v-card-actions >
77+ <v-spacer ></v-spacer >
78+ <v-btn color =" grey" text @click =" resetDialog = false" >
79+ Cancelar
80+ </v-btn >
81+ <v-btn color =" cyan darken-1" dark depressed @click =" resetState" >
82+ Aceptar
83+ </v-btn >
84+ </v-card-actions >
85+ </v-card >
86+ </v-dialog >
87+
6288 <!-- results -->
63- <v-row class = " fill-height " align = " center " justify = " center " >
64- <v-col v-if = " results.length > 0 " cols = " 12 " >
65- <v-chip
66- v-for = " n in sortedResults "
67- :key =" n"
68- :color = " getResultColor(n) "
69- label
70- dark
71- class = " ma-2 font-weight-medium "
72- : class =" getNumberPadding(n) "
73- @click = " workDone (n)"
74- >
75- {{ n }}
76- </ v-chip >
77- </v-col >
89+ <v-fade-transition >
90+ <v-row align = " center " justify = " center " >
91+ <v-col v-if = " results.length > 0 " cols = " 12 " >
92+ < v-chip
93+ v-for =" n in sortedResults "
94+ :key = " n "
95+ :color = " getResultColor(n) "
96+ label
97+ dark
98+ class =" ma-2 font-weight-medium "
99+ :class = " getNumberPadding (n)"
100+ @click = " workDone(n) "
101+ >
102+ {{ n }}
103+ </v-chip >
78104
79- <v-col v-else cols =" 12" class =" mt-16" >
80- <v-img height =" 100%" src =" /analytics.svg" ></v-img >
81- </v-col >
82- </v-row >
105+ <v-btn
106+ color =" error"
107+ class =" mb-10"
108+ dark
109+ absolute
110+ bottom
111+ right
112+ fab
113+ @click =" resetDialog = true"
114+ >
115+ <v-icon >mdi-delete-forever</v-icon >
116+ </v-btn >
117+ </v-col >
118+
119+ <v-col v-else cols =" 12" class =" mt-16" >
120+ <v-img height =" 100%" src =" /analytics.svg" ></v-img >
121+ </v-col >
122+ </v-row >
123+ </v-fade-transition >
83124 </div >
84125</template >
85126
@@ -88,6 +129,7 @@ export default {
88129 data () {
89130 return {
90131 confirmDialog: false ,
132+ resetDialog: false ,
91133 total: null ,
92134 randomNumbers: null ,
93135 results: [],
@@ -136,6 +178,13 @@ export default {
136178 if (this .done .includes (n)) return ' red'
137179 return ' cyan lighten-3'
138180 },
181+ resetState () {
182+ this .resetDialog = false
183+ this .results = []
184+ this .done = []
185+ this .total = null
186+ this .randomNumbers = null
187+ },
139188 },
140189}
141190 </script >
0 commit comments