Vue routing passes parameters, refresh page data becomes [Object Object]
reason:
Refresh the page or return to the previous page, vue passes parameters through routing, refreshes the page or returns to the page, and the data accepted by the page becomes [Object Object].
Example:
First of all, we click "Start Plan" to jump to the "Plan Details" page by routing the parameters!
this.$router.push({
name: "plan", query: {
info: item } });
Later, when I arrived at the specified page, I found that the data was normal:
Then click Refresh, or return from the next page, and find that there is no data, and then we find out by printing that the data has become [Object Object]
Solution:
Before passing, convert the passed parameters into JSON format, and pass JSON.parse() on the accepted page to solve the problem