Advertisement
Guest User

app.js

a guest
Oct 8th, 2018
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. /**
  3.  * First we will load all of this project's JavaScript dependencies which
  4.  * includes Vue and other libraries. It is a great starting point when
  5.  * building robust, powerful web applications using Vue and Laravel.
  6.  */
  7.  
  8. require('./bootstrap');
  9.  
  10. window.Vue = require('vue');
  11. window.VueRouter = require('vue-router').default;
  12. window.VueAxios = require('vue-axios').default;
  13. window.Axios = require('axios').default;
  14.  
  15. /**
  16.  * Next, we will create a fresh Vue application instance and attach it to
  17.  * the page. Then, you may begin adding components to this application
  18.  * or customize the JavaScript scaffolding to fit your unique needs.
  19.  */
  20.  
  21. let AppLayout = require('./components/App.vue');
  22. const HomePage = Vue.component('HomePage', require('./components/HomePage.vue'));
  23. const ServicesPage = Vue.component('ServicesPage', require('./components/ServicesPage.vue'));
  24. const ReviewsPage = Vue.component('ReviewsPage', require('./components/ReviewsPage.vue'));
  25. const ContactsPage = Vue.component('ContactsPage', require('./components/ContactsPage.vue'));
  26.  
  27. Vue.use(VueRouter, VueAxios, Axios);
  28.  
  29. const routes = [
  30.     {
  31.         name: 'HomePage',
  32.         path: '/',
  33.         component: HomePage
  34.     },
  35.     {
  36.         name: 'ServicesPage',
  37.         path: '/show/services',
  38.         component: ServicesPage
  39.     },
  40.     {
  41.         name: 'ReviewsPage',
  42.         path: '/show/reviews',
  43.         component: ReviewsPage
  44.     },
  45.     {
  46.         name: 'ContactsPage',
  47.         path: '/show/contacts',
  48.         component: ContactsPage
  49.     }
  50. ];
  51.  
  52. const router = new VueRouter({ mode: 'history', routes: routes });
  53.  
  54. new Vue(
  55.     Vue.util.extend(
  56.         { router },
  57.         AppLayout
  58.     )
  59. ).$mount('#app');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement