GithubHelp home page GithubHelp logo

vue-multi-pages-config's Introduction

vue-multi-spa

1. Multi-Pages App Structure

It has two apps admin and main

src/apps/admin
   +- router
   +- views
   +- components
   +- index.js (entry point)
   +- AdminApp.vue

src/apps/main
   +- router
   +- views
   +- components
   +- index.js (entry point)
   +- MainApp.vue

, which have their own components, router, etc

Plus, shared components

src
  +- apps
  |    +- admin
  |    |    +- ...
  |    +- main
  |         +- ...
  |
  +- assets      SAHRED
  +- components  SHARED
  +- store(?)    might be SHARED, but not useful
  +- views       SHARED

vue.config.js

each SPA uses its own template html

module.exports = {
  pages: {
    main: {
      entry: './src/apps/main/index.js',
      template: 'public/main.html',
      filename: 'index.html',
      title: 'HOME',
    },
    admin: {
      entry: './src/apps/admin/index.js',
      template: 'public/admin.html',
      filename: 'admin/index.html',
      title: 'ADMIN',
    },
  },
  ...
}
  • main app uses template public/main.html
  • main app is mapped to index.html
  • admin app uses template public/admin.html
  • admin app is mapped to admin/index.html

When connecting http://localhost, dist/index.html is fetched.

When connecting http://locahost/admin, dist/admin/index.html is fetched.

vue-multi-pages-config's People

Contributors

yeori avatar

Watchers

 avatar

Forkers

faaktap

vue-multi-pages-config's Issues

router jump

Hello,I'm learning Vue-MPA too;But I encounter a problem.

When you enter the admin page from the home page, does the router of admin take effect?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.