import Vue from 'vue'
import VueRouter from 'vue-router'
import App from './App.vue'
import vuetify from './plugins/vuetify';

Vue.use(VueRouter)

const Home = { template: '<div><h2>Home Page</h2></div>' }
    // const About = { template: '<div><h2>About Page</h2></div>' }
const Contact = { template: '<div><h2>Contact Page</h2></div>' }

const routes = [
    { path: '/', component: Home },
    {
        path: '/signin',
        beforeEnter: (to, from, next) => {
            window.location.replace('/signin');
        }
    },
    { path: '/contact', component: Contact }
]

const router = new VueRouter({
    routes,
    mode: 'history'
})

new Vue({
    el: '#app',
    vuetify,
    router,
    render: h => h(App),
    mounted() {
        // You'll need this for renderAfterDocumentEvent.
        document.dispatchEvent(new Event('render-event'))
    }
})