Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

profil.js 1.9KB

5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. const ProfilRouter = {
  2. template: `
  3. <div>
  4. <div class="is-hidden-desktop">
  5. <div v-if="isAuth">
  6. <profil-card></profil-card>
  7. </div>
  8. <div v-else>
  9. <button class="button is-primary is-medium"
  10. @click="isLPVisible = true">
  11. Login
  12. </button>
  13. <b-modal :active.sync="isLPVisible"
  14. @close-login-panel="closeLoginPanel"
  15. @show-login-panel="showLoginPanel"
  16. has-modal-card>
  17. <login-panel></login-panel>
  18. </b-modal>
  19. </div>
  20. </div>
  21. <div class="column is-three-quarters is-pulled-right is-hidden-touch content-desktop">
  22. <div v-if="isAuth">
  23. <profil-card></profil-card>
  24. </div>
  25. <div v-else>
  26. <button class="button is-primary is-medium"
  27. @click="isLPVisible = true">
  28. Login
  29. </button>
  30. <b-modal :active.sync="isLPVisible"
  31. @close-login-panel="closeLoginPanel"
  32. @show-login-panel="showLoginPanel"
  33. has-modal-card>
  34. <login-panel></login-panel>
  35. </b-modal>
  36. </div>
  37. </div>
  38. </div>`,
  39. data: function () {
  40. return {
  41. isAuth: false,
  42. isLPVisible: false,
  43. };
  44. },
  45. methods: {
  46. closeLoginPanel: function() {
  47. this.isLPVisible = false;
  48. },
  49. showLoginPanel: function() {
  50. this.isLPVisible = true;
  51. },
  52. },
  53. created: function() {
  54. //console.info(auth);
  55. },
  56. beforeMount: function() {
  57. this.isAuth = (auth != null && auth.mail != '');
  58. //console.info('beforeMount: '+this.isAuth);
  59. },
  60. };