import { createApp } from "vue";
import "./style.css";
import App from "./App.vue";

import { createWebHashHistory, createRouter } from "vue-router";
import ListAll from "./views/ListAll.vue";
import AddNew from "./views/AddNew.vue";
import Navigation from "./views/Navigation.vue";
import Tab2 from "./views/Tab2.vue";

if (jsData.page_slug === "vueplugin1-id") {
  const routes = [
    { path: "/", components: { default: ListAll } },
    { path: "/add-new", components: { default: AddNew, tab: Navigation } },
    { path: "/tab-2", components: { default: Tab2, tab: Navigation } },
  ];

  const router = createRouter({
    history: createWebHashHistory(),
    routes,
  });

  createApp(App).use(router).mount("#vue-plugin-1-app");
}
