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

105
Views
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 answers
Answer question

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 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!