index.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. {% extends "base.html" %}
  2. {% block body %}
  3. <div id="app">
  4. <div class="md-layout">
  5. <div class="md-layout-item" md-card>
  6. <md-table id="schedules-table" v-model="schedules">
  7. <md-table-toolbar>
  8. <h1 class="md-title">Schedules <a href="schedule.html">add new</a></h1>
  9. </md-table-toolbar>
  10. <md-table-row slot="md-table-row" slot-scope="{item}">
  11. <md-table-cell md-label="#" md-sort-by="id" md-numeric>${ item.id }</md-table-cell>
  12. <md-table-cell md-label="title" md-sort-by="title">${ item.title }</md-table-cell>
  13. <md-table-cell md-label="url" md-sort-by="email">${ item.url }</md-table-cell>
  14. </md-table-row>
  15. </md-table>
  16. </div>
  17. </div>
  18. </div>
  19. <script>
  20. Vue.use(VueMaterial.default);
  21. var app = new Vue({
  22. el: '#app',
  23. delimiters: ['${', '}'],
  24. data: {
  25. schedules: []
  26. },
  27. mounted: function() {
  28. this.getSchedules();
  29. },
  30. methods: {
  31. getSchedules: function() {
  32. self = this;
  33. var data = axios.get('/api/schedules').then(function(response) {
  34. console.log(response);
  35. self.schedules = response.data.schedules || [];
  36. });
  37. }
  38. }
  39. });
  40. </script>
  41. <style>
  42. body {
  43. background-color: white;
  44. }
  45. .md-table {
  46. width: 60%;
  47. min-height: 200px;
  48. max-height: 600px;
  49. }
  50. </style>
  51. {% end %}