Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

197
Visualizações
How to open this route in new window?
if (success) {
          context.bookingData.city = context.city;
          context.bookingData.departureFlightDate = context.departureFlightDate;
          context.bookingData.arrivalFlightDate = context.arrivalFlightDate;
          context.bookingData.idParkingService = context.idParkingService;
          context.bookingData.Price = context.bookings.price.items.data.price;

          //const booking = JSON.stringify(context.bookingData);
          context.addBookingData(context.bookingData);
          context.$router.push({
            path: "parkplatz-buchen-schritt-2",
          });
        }

how to open this path in new window or tab at the same time I have to pass context data to the destination

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

To open the route in a new window

Home.vue

<template>
 <button v-on:click="openInNewWindow()">Open in new window</button>
</template>

<script>

export default {
  methods: {
    openInNewWindow(){
      let routeData = this.$router.resolve({
        path: '/about',
        query: {
          city : 'test',
          departureFlightDate : 'test',
          arrivalFlightDate : 'test',
          idParkingService : 'test',
          price : 'test'
        }
      });
      window.open(routeData.href, '_blank');
    }
  }
}
</script>

Router

import Home from '../views/Home.vue'
import About from '../views/About.vue'


const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    component: About
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router

About.vue

<template>
  <div class="about">
    <h1>This is an about page</h1>
    {{this.$route.query.city}}
  </div>
</template>

<script>
export default {
  mounted(){
    console.log(this.$route.query)
  }
}
</script>
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda