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. <v-rating v-model="rating"></v-rating>
  15. <login-panel v-if="showLoginModal" @clicked="closeModal" ></login-panel>
  16. </div>
  17. </div>`,
  18. data: function () {
  19. return {
  20. profilcard: _profilcard,
  21. showLoginModal: false,
  22. isAuthentified: false,
  23. rating: 3,
  24. };
  25. },
  26. methods: {
  27. closeModal (value) {
  28. this.showLoginModal = value;
  29. this.isAuthentified = !this.isAuthentified;
  30. },
  31. logIn (value) {
  32. this.showLoginModal=false;
  33. },
  34. logOut () {
  35. this.isAuthentified=false;
  36. },
  37. },
  38. };
  39. /*
  40. $('#myModal').on('show.bs.modal', function (event) {
  41. console.log("Modal Opened")
  42. var button = $(event.relatedTarget) // Button that triggered the modal
  43. var recipient = button.data('whatever') // Extract info from data-* attributes
  44. // If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
  45. // Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
  46. var modal = $(this)
  47. modal.find('.modal-title').text('New message to ' + recipient)
  48. modal.find('.modal-body input').val(recipient)
  49. })
  50. */