On the data interaction of vue using window.open to open a new window

1, for single-page applications, using vue to open a new window is through window.open (). The new window page gets new data and displays it, which is relatively easy. You can pass the parameter url with the data in the past, but now there is a problem. How does the new window actively trigger the method in the original window. For example, there is a method for obtaining list data in the original window getList (),. When the new window is filled with data and submitted, it actively triggers the getList method of the original window


you can get the window object of the original window through window.opener .

then, there are several ways to do this:

1 window.opener.postMessage && window.addEventListener

2 `window.opener.location.hash`getList

3 `window.opener.name`(localStorage)
Menu