SoFunction
Updated on 2025-04-12

vue route jump opens a new window and is intercepted by the browser. The problem is handled.

The trigger event request interface determines that the routing is being performed based on the conditions:

  <a @click="getGetMyPortfolioById() ">Check</a>
 
 getGetMyPortfolioById(vals) { 
    getMyPortfolioById({
 
    }).then(response = >{ 
        const routerdata = this.$({ 
                  name: 'Combination Analysis and Combination Position', 
                  params: { managerId:  } 
        }) 
        const newhref =  + '?managerId=' +  
         (newhref, '_blank') 
    })
 } 

When we use the above method, it triggers the event request interface to determine that the routing is being performed based on the conditions, and at this time we will encounter the problem of the browser being intercepted.
In the callback function requested by the interface, it needs to be used()Open a new page, but after the interface request is successful, () opens a new page and is always intercepted by the browser. The reason is probably that the operation placed in the request callback function is considered by the browser not to be triggered by the user and delayed1000ms , considered possible to be an advertisement, so it was blocked

Solution:

Open an empty page before the interface requests:

let tempPage=('' ", _blank');

Then in the callback function:

=url;

(Added version)

  <a @click="getGetMyPortfolioById() ">Check</a>
 
  getGetMyPortfolioById(vals) {
      const tempPage = ('', '_blank')
      getMyPortfolioById({}).then(response = >{
             const routerdata = this.$({
             name: 'Combination Analysis and Combination Position',
                  params: {
                       managerId: 
                 }
               })
             const newhref =  + '?managerId=' + 
              = newhref
      })
 }

This is the article about the problem of handling vue routing jump opening a new window being intercepted by the browser. For more related vue routing jump content, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!