Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
338 views
in Technique[技术] by (71.8m points)

vue.js - How can I integrate a static landing page in a VueJS app?

I'm trying to put a static landing page and a vuejs app together, but I need some help.

The guide at VueJS Documentation for multipage apps is not that clear or maybe not for my case: I don't have any js file to point to for the static page.

pages: {
  landingpage: {
    entry: 'src/landingpage/main.js', //entry for the public page
    template: 'public/index.html', // source template
    filename: 'index.html' // output as dist/*
  },
  app: {
    entry: 'src/app/main.js', //entry for the app page
    template: 'public/app.html',
    filename: 'app.html'
  }
}

I also tried moving the pages to a different location in the vue router, but no success.

routes: [
    {
      path: '/app/', // root of the app
      name: 'Signin',
      component: Signin
    }
    ...

How can I solve this?

Edit: I use vue-cli


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It came out that vue routing was not my problem. I reverted the vuejs app to be only managing dynamic content and created another project to manage the landing page.

Then I was able to configure a subdomain to manage the dynamic part of the site while the main domain was dedicated to the landing page.

In the end, the routing was made at level of the DNS, using A records to drive the request to a project or the other.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
...