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

109
Visualizações
Random Landing Page (Vue / Javascript)

I would like to show a different .vue file when the visitor refreshes the Home page.

Right now I have one page called Home.vue I'm trying to load Home1.vue Home2.vue randomly on every refresh.

{
  path: '/',
  name: 'home',
  component: () => import('./views/Home.vue')
},

Maybe I have have one "homepage" but the whole content/template can be loaded randomly.

Can someone figure out how to archive this?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

import function takes the path as the string may this will help you

const pages = ['home.vue', 'about.vue', 'third.vue']
import(`./views/${pages[Math.floor(Math.random()*pages.length)]}`)

Good luck!

about 4 years ago · Juan Pablo Isaza 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