When vue router jumps to a page, it occasionally returns to the route when it opens a new window.

problem description

when vue router jumps to a page, it occasionally returns to routing when a new window is opened. This problem only occurs after packaging and release

.

Project is built with vue-cli3.0

the environmental background of the problems and what methods you have tried

Today, when you work on a project, you need to open a new window and find that you will occasionally return to follow the route. After that, you will write a very simple demo discovery that will indeed trigger

.

related codes

/ / Please paste the code text below (do not replace the code with pictures)
< template >

<a href="-sharp/filter"
   target="_blank">filter</a>
<router-link to="/filter"
             target="_blank">
  router-link</router-link>

< / div >
< / template >
< script >
export default {
data () {

return {}

}
}
< / script >
< style >
< / style >
router.js is also a very simple thing
clipboard.png

what result do you expect? What is the error message actually seen?

normally, you should jump to xxx/filter. The implementation is xxx/

.

add

found that hooks such as beforeRouteEnter will not trigger

Jul.04,2021

there are many pits in this way. It is recommended not to use vue routing. Even if you can open it, you may not be able to inherit the css style of the new page. There has been such a business before, and then it is changed to vue to open a new tab page with a pass number to request the backend. Render under the new tab.

concatenate the href link of a, create the element, hide it, and then trigger it with the native click,
this.openUrl = `/-sharp/init/leadContact/exclErrInfo?filename=$ {fileName} & errdata=$ {errdata}
but after the new tab is opened, the style in the vue is not available online after the project is packaged.


Hello, has this problem been solved? I also encountered the same problem


landlord, has this problem been solved? I have the same problem

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-1b3e7cd-2c41f.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-1b3e7cd-2c41f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?