uniapp jump in when the page, if the URL is too long a string can cause data transfer failure

url have length restrictions, too long string delivery failure, using a form of communication , global variables , or encodeURIComponentother means to solve, as to encodeURIComponentthe solution of example.

<navigator :url="'/pages/test/test?item='+ encodeURIComponent(JSON.stringify(item))"></navigator>
// accept parameters test.vue page in 
the onLoad: function (Option) { 
    const Item = the JSON.parse (decodeURIComponent (option.item)); 
}

Content from uniapp official website

Guess you like

Origin www.cnblogs.com/lwming/p/11498274.html