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.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. const ProfilRouter = {
  2. template: `
  3. <div>
  4. <div v-if="isAuthentified">
  5. <ProfilCard
  6. v-for="(profil, index) in profilcard"
  7. :key="profil.id"
  8. :profil="profil"
  9. ></ProfilCard>
  10. <button type="button" class="btn btn-primary" data-dismiss="modal" v-on:click="logOut() ">Logout</button>
  11. </div>
  12. <div v-else-if="!isAuthentified">
  13. <button v-on:click="showLoginModal=true" @clicked="logIn">Login</button>
  14. <login-panel v-if="showLoginModal" @clicked="closeModal" ></login-panel>
  15. </div>
  16. </div>`,
  17. data: function () {
  18. return {
  19. profilcard: _profilcard,
  20. showLoginModal: false,
  21. isAuthentified: false,
  22. };
  23. },
  24. methods: {
  25. closeModal (value) {
  26. this.showLoginModal = value;
  27. this.isAuthentified = !this.isAuthentified;
  28. },
  29. logIn (value) {
  30. this.showLoginModal=false;
  31. },
  32. logOut () {
  33. this.isAuthentified=false;
  34. },
  35. },
  36. };
  37. /*
  38. $('#myModal').on('show.bs.modal', function (event) {
  39. console.log("Modal Opened")
  40. var button = $(event.relatedTarget) // Button that triggered the modal
  41. var recipient = button.data('whatever') // Extract info from data-* attributes
  42. // If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
  43. // Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
  44. var modal = $(this)
  45. modal.find('.modal-title').text('New message to ' + recipient)
  46. modal.find('.modal-body input').val(recipient)
  47. })
  48. */