Skouter mortgage estimates. Web application with view written in PHP and Vue, but controller and models in Go.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

55 lines
885 B

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