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

6 years ago
6 years ago
6 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. const ('Home', {
  2. template: ` <div id="message-list" v-for="(msg, index) in messages" :key="msg.id" :subject="msg.subject" :message="msg.message" :tag="msg.tag" :user="msg.user">
  3. <div class="om-card card">
  4. <h6 class="msg-head">
  5. <b>{{ subject }}</b>
  6. <img src="favicon.ico" width=20px height=20px>
  7. </h6>
  8. {{ message }}<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: ['subject', 'message', 'tag', 'user']
  15. })
  16. new Vue({
  17. el: '#message-list',
  18. data: {
  19. messages: [
  20. {
  21. id: 1,
  22. subject: 'Betreff',
  23. message: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam.',
  24. tag: '#efi #bme #semester',
  25. user: 'user_1'
  26. },
  27. {
  28. id: 2,
  29. subject: 'Betreff',
  30. 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.',
  31. tag: '#efi #fachschaft',
  32. user: 'user_2'
  33. },
  34. {
  35. id: 3,
  36. subject: 'Betreff',
  37. message: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam.',
  38. tag: '#efi #bei #wichtig',
  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. */