what i am trying to do is click a button add 1 times 1 but that count is not lost when reloading the page
idi(){
this.suma=this.suma+1;
}
I only have this, but when reloading the page the value is lost and it starts from 0
please use localStorage
to store the information and retrieve it back once the page reloads.
localStorage.setItem('myCat', 'Tom');
stores the value
const cat = localStorage.getItem('myCat');
retrieves the value.
More info here. https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.