Added a Clear History button
This commit is contained in:
@@ -107,6 +107,9 @@
|
|||||||
<fieldset class="history hidden">
|
<fieldset class="history hidden">
|
||||||
<legend v-on:click="collapse">History ↕</legend>
|
<legend v-on:click="collapse">History ↕</legend>
|
||||||
<div class="collapsible">
|
<div class="collapsible">
|
||||||
|
<ul>
|
||||||
|
<li><button v-on:click="clearHistory">Clear History</button></li>
|
||||||
|
</ul>
|
||||||
<ul v-for="entry in history">
|
<ul v-for="entry in history">
|
||||||
<li>
|
<li>
|
||||||
<label for="time">Time</label>
|
<label for="time">Time</label>
|
||||||
|
|||||||
@@ -79,6 +79,12 @@ const app = new Vue({
|
|||||||
this.history.splice(this.history.indexOf(entry), 1)
|
this.history.splice(this.history.indexOf(entry), 1)
|
||||||
window.localStorage.setItem('history', JSON.stringify(this.history))
|
window.localStorage.setItem('history', JSON.stringify(this.history))
|
||||||
},
|
},
|
||||||
|
|
||||||
|
clearHistory() {
|
||||||
|
this.history = []
|
||||||
|
window.localStorage.setItem('history', JSON.stringify(this.history))
|
||||||
|
},
|
||||||
|
|
||||||
useHistory({
|
useHistory({
|
||||||
method,
|
method,
|
||||||
url,
|
url,
|
||||||
|
|||||||
Reference in New Issue
Block a user