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

301
Views
¿Cómo puedo usar RouterLink para acceder a una página externa en Vue3?

Estoy trabajando en un proyecto con Vue3 para enumerar todas las universidades de Suecia y tengo problemas con RouterLink para llevar al usuario a una página externa y a la página web oficial de las universidades. ¿Alguien tiene algunos consejos para solucionar este problema?

Este es mi archivo App.vue:

 <script> import TheHeader from "./components/styling/TheHeader.vue"; import UniversityList from "./pages/universities/UniversityList.vue"; export default { components: { TheHeader, UniversityList } } </script> <template> <TheHeader /> <university-list v-for="res in universities" :name="res.name" :country="res.country" :web_pages="res.web_pages" ></university-list> <RouterView/> </template> <style> @import url('https://fonts.googleapis.com/css2?family=Epilogue:wght@400;700&display=swap'); html { font-family: 'Epilogue', sans-serif; } * { box-sizing: border-box; } body { margin: 0; } </style>

Y esto es UniversityList.vue

 <template><ul> <li v-for="university in universities"> <div class="info"> <h3>{{ university.name }}, {{ university.country }}</h3> <RouterLink v-bind:to="university.web_pages">Källa</RouterLink> </div> </li> </ul> <RouterView/> </template> <script> export default { created() { fetch('http://universities.hipolabs.com/search?country=Sweden') .then((response) => response.json()) .then((result) => { this.universities = result }) }, data() { return { universities: null} }, props: ['name', 'country', 'web_pages'] } </script> <style> body { background-color: #dda15e; } .info { max-width: 800px; margin: 15px auto; background: white; border: 1px solid #424242; border-radius: 12px; padding-left: 20px; } h3 h4 { margin: 1rem 0; padding: 1rem; } </style>

¡Gracias por adelantado!

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

El enlace del enrutador solo funciona en su proyecto, por lo que debe usar

ancla <a href="#"></a>

about 4 years ago · Juan Pablo Isaza Report

0

Solo debe usar la etiqueta de anclaje, RouterLink es para rutas internas

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!