app.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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: getIdAsString,
  40. }
  41. ],
  42. })
  43. function getIdAsString ( route ) {
  44. return { id: route.params.id.toString() }
  45. }
  46. const app = new Vue({
  47. el: '#app',
  48. components: { App },
  49. router,
  50. })
  51. $(function () {
  52. $('[data-toggle="tooltip"]').tooltip()
  53. });
  54. var clipboard = new Clipboard('.btn-clip');
  55. clipboard.on('success', function(e) {
  56. $('#' + e.trigger.getAttribute('id')).notify('Copied to Clipboard', {position:"right", className:'success'});
  57. e.clearSelection();
  58. });