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.

home.js 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. Vue.component('msg-item', {
  2. template: `<div class="om-card card">
  3. <h6 class="msg-head">
  4. <b>{{ subject }}</b>
  5. <img src="favicon.ico" width=20px height=20px>
  6. </h6>
  7. {{ message }}<br><br>
  8. <a href="#">{{ tag }}</a></p>
  9. <div class="om-user-line">
  10. <i class="material-icons">account_circle</i>
  11. Erstellt von {{ user }}
  12. </div>`,
  13. props: ['subject', 'message', 'tag', 'user']
  14. })
  15. new Vue({
  16. el: '#message-list',
  17. data: {
  18. messages: [
  19. {
  20. id: 1,
  21. subject: 'Betreff_1',
  22. message: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam.',
  23. tag: '#efi #bme #semester',
  24. user: 'user_1'
  25. },
  26. {
  27. id: 2,
  28. subject: 'Betreff_2',
  29. message: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.',
  30. tag: '#efi #fachschaft',
  31. user: 'user_2'
  32. },
  33. {
  34. id: 3,
  35. subject: 'Betreff_3',
  36. message: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam.',
  37. tag: '#efi #bei #wichtig',
  38. user: 'user_3'
  39. }
  40. ],
  41. },
  42. })
  43. /* First try of vue-componetn -> does not work
  44. Vue.component('home', {
  45. data: function () {
  46. return {
  47. }
  48. },
  49. template:
  50. `<div id="sample">
  51. <div v-for="msgs in private.messages">
  52. <div class="om-card card" v-for="elements in msgs.message">
  53. <h6 class="msg-head">
  54. <b>{{elements.subject}}</b>
  55. <img src="favicon.ico" width=20px height=20px>
  56. </h6>
  57. <p>{{elements.msg}}<br>
  58. <a href="#">{{elements.tags}}</a></p>
  59. <div class="om-user-line">
  60. <i class="material-icons">account_circle</i>
  61. Erstellt von {{elements.user}}
  62. </div>
  63. </div>
  64. </div>
  65. </div>`
  66. })
  67. */