Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Layout design on the basis of hostname. #3345

Closed
saileshkush95 opened this issue Oct 15, 2020 · 1 comment
Closed

Handle Layout design on the basis of hostname. #3345

saileshkush95 opened this issue Oct 15, 2020 · 1 comment

Comments

@saileshkush95
Copy link

I'm using this code to distinguish routes of different hostname.

import default_routes from "./default";
import tenantone from "./tenantone";
import tenanttwo from "./tenanttwo";

const currentHostName = window.location.hostname;
let router;

if (currentHostName === "127.0.0.1") {
  router = tenantone;
} else if (currentHostName === "localhost") {
  router = tenanttwo;
} else {
  router = default_routes;
}

export default router;

and this is working properly but I've little bit issue. Since every hostname has completely different layout. for example when i'm using this code in App.vue

<template>
    <div id="nav">
      <router-link to="/">Home</router-link>
      <router-link to="/about">About</router-link>
    </div>
  <router-view />
</template>

<script>
export default {
  name: "App",

  data: () => ({
    //
  }),
};
</script>

Navbar is available in all the tenant. and also this is the problem. How can I handle this situation properly. because, each and every tenant have its own navbar design and layout. I didn't want to repeat myself.

and here is my project layout.

Screenshot from 2020-10-15 20-23-14

@vue-bot
Copy link

vue-bot commented Oct 15, 2020

Hello, thank you for taking time filling this issue!

However, we kindly ask you to use our Issue Helper when creating new issues, in order to ensure every issue provides the necessary information for us to investigate. This explains why your issue has been automatically closed by me (your robot friend!).

I hope to see your helper-created issue very soon!

@vue-bot vue-bot closed this as completed Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants