Skouter mortgage estimates. Web application with view written in PHP and Vue, but controller and models in Go.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

55 lignes
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>