The use of localStorage by vue does not take effect.

methods: {
applyFree () {

 localStorage.setItem("resultList", res.list);

}
}

I added local storage here why I didn"t save it. The browser localStorage does not have this field, but what happens when it does not take effect? there is no response. It doesn"t work to execute this directly in the browser: localStorage.setItem ("resultList", "11");

Jul.20,2021

I found out why, because I used global listening for local storage in another vue interface that is worth changing, so writing this later doesn't work. After that, the global monitoring local storage is removed and it will take effect.


1. Has this function been called?
where did 2.res come from?


res.list did not get the value, how do you define


localStorage stores strings. Do you see if res.list is a JSON string? if not, you should write

like this.
localStorage.setItem("resultList", JSON.stringify(res.list));

you need to change res.list into a string
I guess res.list is an array
https://www.cnblogs.com/LeoBo.

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c5b0-2c2ec.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c5b0-2c2ec.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?