Skouter mortgage estimates. Web application with view written in PHP and Vue, but controller and models in Go.
 
 
 
 
 
 

56 lines
931 B

  1. <template>
  2. <div class="panel">
  3. <side-bar :role="user.status" :active="active">
  4. </side-bar>
  5. <div v-if="loading" class="page">
  6. <spinner></spinner>
  7. </div>
  8. <div v-else-if="!loading"></div>
  9. </div>
  10. </template>
  11. <script>
  12. import SideBar from "./sidebar.vue"
  13. import Spinner from "./spinner.vue"
  14. const user = {
  15. firstName: "test",
  16. lastName: "user",
  17. id: 12,
  18. status: 1,
  19. }
  20. function active() {
  21. if (this.hash == '' || this.hash == '#') {
  22. return 1
  23. } else if (/^#new\/?/.exec(this.hash)) {
  24. return 2
  25. } else if (/^#estimates\/?/.exec(this.hash)) {
  26. return 3
  27. } else if (/^#settings\/?/.exec(this.hash)) {
  28. return 4
  29. } else if (/^#sign-out\/?/.exec(this.hash)) {
  30. return 5
  31. } else {
  32. return 0
  33. }
  34. }
  35. export default {
  36. components: {SideBar, Spinner},
  37. computed: {active},
  38. data() {
  39. return {
  40. loading: true, user: user, hash: ''
  41. }
  42. },
  43. created() {
  44. window.onhashchange = () => this.hash = window.location.hash
  45. }
  46. }
  47. </script>