Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

196
Views
El iframe en el componente Vue se abre en una nueva pestaña (solo Safari) ----- a veces

Tengo un componente Vue que contiene un IFrame. El componente realiza llamadas a la API, utilizando una tienda Vuex, para obtener información para un SSO que se cargará en el IFrame. La primera vez que se monta el componente, se carga perfectamente en el IFrame. Pero cuando cambio de pantalla y el componente se vuelve a montar, el SSO se carga en una nueva pestaña. Luego, si voy a otra pantalla, vuelve a cargar bien. Entonces, el problema de la nueva pestaña solo ocurre cada dos veces que se monta el componente.

Cabe señalar que este comportamiento solo aparece en Safari. Funciona como se espera en cualquier otro lugar.

Mi código es bastante similar a este. Tuvo que modificar por razones de propiedad.

 <template> <div> <form :action="endPoint" target="the_iframe" ref="ssoForm" method="POST" name="ssoForm" id="ssoForm" > <input id="AuthCode" type="hidden" name="AuthCode" :value="authorizationCode" /> <input id="AuthAppUrl" type="hidden" name="AuthAppUrl" :value="authAppUrl" /> </form> <iframe width="100%" name="the_iframe" height="300" style="display: flex" id="the_iframe" frameborder="0" ></iframe> </div> </template> <script> import types from "path/to/types" export default { data() { return { endPoint: null, authorizationCode: null, authAppUrl: null, errorStatus: false, error: null } }, methods: { async getSSOModel() { try { var data = await this.$store.dispatch( `store/${types.GET_SSO_MODEL}` ) this.endPoint = data.endPoint this.authorizationCode = data.authorizationCode this.authAppUrl = data.authAppUrl await this.$nextTick() this.$refs.ssoForm.submit() } catch (error) { this.error = error this.errorStatus = true } } }, async mounted() { await this.getSSOModel() } } </script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Terminé moviendo el componente un nivel. El componente se recargaba/montaba cada vez que cambiaba la ruta. Lo moví hacia arriba, por lo que solo tuvo que cargar una vez. Esto parece ser más una solución que una solución, pero funciona.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!