[Vuejs]-Vue router open a new tab with params (Params are empty)

5👍

You could use Local Storage to pass hidden (not shown in URL) parameters to the new window:

Before opening the page, save the parameters:

localStorage['params'] = JSON.stringify({
  param1: 'value1',
  param2: 'value2',
})

Then restore them in your component when needed:

let params = {}
try {
  params = JSON.parse(localStorage['params'])
} catch (error) {
  // ignore
}
👤tony19

Leave a comment