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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. Vue.component('msg-item', {
  2. template: `<div class="om-card card">
  3. <h6 class="msg-head">
  4. <b>{{ title }}</b>
  5. <img src="favicon.ico" width=20px height=20px>
  6. </h6><br>
  7. {{ subject }}<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: ['title', 'subject', 'tag', 'user']
  14. })
  15. new Vue({
  16. el: '#newmessages-example',
  17. data: {
  18. messages: [
  19. {
  20. id: 1,
  21. title: 'Betreff_1',
  22. subject: 'Nachricht_1',
  23. tag: '#tag_1',
  24. user: 'user_1'
  25. },
  26. {
  27. id: 2,
  28. title: 'Betreff_2',
  29. subject: 'Nachricht_2',
  30. tag: '#tag_2',
  31. user: 'user_2'
  32. },
  33. {
  34. id: 3,
  35. title: 'Betreff_3',
  36. subject: 'Nachricht_3',
  37. tag: '#tag_3',
  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. new Vue({
  68. el: '#sample',
  69. data: {
  70. private: {
  71. messages : [
  72. {
  73. message : [
  74. {subject : 'Betreff_1'},
  75. { msg : 'Nachricht_1' },
  76. { tags : '#tag_1' },
  77. { user : 'user_1' }
  78. ]
  79. },
  80. {
  81. message : [
  82. {subject : 'Betreff_2'},
  83. { msg : 'Nachricht_2' },
  84. { tags : '#tag_2' },
  85. { user : 'user_2' }
  86. ]
  87. },
  88. {
  89. message : [
  90. {subject : 'Betreff_3'},
  91. { msg : 'Nachricht_3' },
  92. { tags : '#tag_3' },
  93. { user : 'user_3' }
  94. ]
  95. }
  96. ]
  97. }
  98. }
  99. })
  100. */