app.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /**
  2. * First we will load all of this project's JavaScript dependencies which
  3. * includes Vue and other libraries. It is a great starting point when
  4. * building robust, powerful web applications using Vue and Laravel.
  5. */
  6. require('./bootstrap');
  7. window.Clipboard = require('clipboard');
  8. require('./notify.min.js');
  9. import Vue from 'vue'
  10. import VueRouter from 'vue-router'
  11. Vue.use(VueRouter)
  12. import App from './views/App'
  13. import Dashboard from './views/Dashboard'
  14. import WorkOrder from './views/WorkOrder'
  15. import Login from './views/Login'
  16. import Home from './views/Welcome'
  17. const router = new VueRouter({
  18. mode: 'history',
  19. routes: [
  20. {
  21. path: '/',
  22. name: 'home',
  23. component: Home
  24. },
  25. {
  26. path: '/login',
  27. name: 'login',
  28. component: Login,
  29. },
  30. {
  31. path: '/dashboard',
  32. name: 'dashboard',
  33. component: Dashboard,
  34. },
  35. {
  36. path: '/workorders/:id',
  37. name: 'workorders',
  38. component: WorkOrder,
  39. props: true,
  40. }
  41. ],
  42. })
  43. const app = new Vue({
  44. el: '#app',
  45. components: { App },
  46. router,
  47. })
  48. $(function () {
  49. $('[data-toggle="tooltip"]').tooltip()
  50. });
  51. var clipboard = new Clipboard('.btn-clip');
  52. clipboard.on('success', function(e) {
  53. $('#' + e.trigger.getAttribute('id')).notify('Copied to Clipboard', {position:"right", className:'success'});
  54. e.clearSelection();
  55. });