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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. Vue.component('msg-item', {
  2. template: `<div id="newmessages-example">
  3. <div class="om-card card">
  4. <h6 class="msg-head">
  5. <b>{{ title }}</b>
  6. <img src="favicon.ico" width=20px height=20px>
  7. </h6><br>
  8. {{ subject }}<br><br>
  9. <a href="#">{{ tag }}</a></p>
  10. <div class="om-user-line">
  11. <i class="material-icons">account_circle</i>
  12. Erstellt von {{ user }}
  13. </div></div>`,
  14. props: ['title', 'subject', 'tag', 'user']
  15. })
  16. new Vue({
  17. el: '#mewmessages-example',
  18. data: {
  19. messages: [
  20. {
  21. id: 1,
  22. title: 'Betreff_1',
  23. subject: 'Nachricht_1',
  24. tag: '#tag_1',
  25. user: 'user_1'
  26. },
  27. {
  28. id: 2,
  29. title: 'Betreff_2',
  30. subject: 'Nachricht_2',
  31. tag: '#tag_2',
  32. user: 'user_2'
  33. },
  34. {
  35. id: 3,
  36. title: 'Betreff_3',
  37. subject: 'Nachricht_3',
  38. tag: '#tag_3',
  39. user: 'user_3'
  40. }
  41. ],
  42. },
  43. })
  44. /* First try of vue-componetn -> does not work
  45. Vue.component('home', {
  46. data: function () {
  47. return {
  48. }
  49. },
  50. template:
  51. `<div id="sample">
  52. <div v-for="msgs in private.messages">
  53. <div class="om-card card" v-for="elements in msgs.message">
  54. <h6 class="msg-head">
  55. <b>{{elements.subject}}</b>
  56. <img src="favicon.ico" width=20px height=20px>
  57. </h6>
  58. <p>{{elements.msg}}<br>
  59. <a href="#">{{elements.tags}}</a></p>
  60. <div class="om-user-line">
  61. <i class="material-icons">account_circle</i>
  62. Erstellt von {{elements.user}}
  63. </div>
  64. </div>
  65. </div>
  66. </div>`
  67. })
  68. new Vue({
  69. el: '#sample',
  70. data: {
  71. private: {
  72. messages : [
  73. {
  74. message : [
  75. {subject : 'Betreff_1'},
  76. { msg : 'Nachricht_1' },
  77. { tags : '#tag_1' },
  78. { user : 'user_1' }
  79. ]
  80. },
  81. {
  82. message : [
  83. {subject : 'Betreff_2'},
  84. { msg : 'Nachricht_2' },
  85. { tags : '#tag_2' },
  86. { user : 'user_2' }
  87. ]
  88. },
  89. {
  90. message : [
  91. {subject : 'Betreff_3'},
  92. { msg : 'Nachricht_3' },
  93. { tags : '#tag_3' },
  94. { user : 'user_3' }
  95. ]
  96. }
  97. ]
  98. }
  99. }
  100. })
  101. */