This commit is contained in:
@@ -43,13 +43,28 @@
|
||||
type: String,
|
||||
default: 'nagyonhosszezugyselesz'
|
||||
},
|
||||
index: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
}
|
||||
|
||||
},
|
||||
mounted() {
|
||||
if (localStorage.getItem('guesses')) {
|
||||
try {
|
||||
this.guesses = JSON.parse(localStorage.getItem('guesses'));
|
||||
} catch(e) {
|
||||
localStorage.removeItem('guesses');
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onsubmit () {
|
||||
if (this.guess.length == this.correct.length) {
|
||||
this.guesses.push(this.guess);
|
||||
this.guess = '';
|
||||
|
||||
localStorage.guesses[this.index] = this.guesses;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user