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 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. const HomeRouter = {
  2. template: `
  3. <div>
  4. <div id="om-msg-cards" class="column pull-right-sm is-four-fifths-desktop">
  5. <a v-if="isSearchActiv" @click="goBackToDashboard">< zurück zu allen Einträgen</a>
  6. <b-button class="subscribe-btn" v-if="isSubscripeButtonActiv" type="is-primary" @click="">#IPSUM ABONNIEREN</b-button>
  7. <MsgCard
  8. v-for="id in messagelist.slice().reverse()"
  9. :key="id"
  10. :msg="messages[id] || {}"
  11. ></MsgCard>
  12. </div>
  13. </div>`,
  14. data: function () {
  15. return {
  16. messagelist: _messagelist,
  17. messages: _messages,
  18. isSearchActiv: _isSearchActiv,
  19. isSubscripeButtonActiv: _isSubscripeButtonActiv
  20. };
  21. },
  22. methods: {
  23. list_messages: function() {
  24. messages();
  25. },
  26. goBackToDashboard: function() {
  27. //Home neu rendern ...
  28. //windows.history.go();
  29. _isSearchActiv = false;
  30. }
  31. },
  32. mounted: function () {
  33. this.list_messages();
  34. //this.refresh_messages();
  35. }
  36. };
  37. function get_insert_message(id) {
  38. $.ajax({ url: "api/msg/id/"+id, method: "GET" }).done(function (msg) {
  39. Vue.set(_messages, id, msg);
  40. }).fail(function (e, f, g) {
  41. console.log("cannot load " + id + ".json: " + e + f + g);
  42. })
  43. }