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.

templatePage.vue 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <div class="container-fluid" style="margin-top:25px;">
  3. <div class="row">
  4. <div class="col-md-1"></div>
  5. <div class="col-md-10">
  6. <div class>
  7. <h3 class="sinse-title">Email Templates</h3>
  8. </div>
  9. </div>
  10. <div class="col-md-12">
  11. <hr />
  12. </div>
  13. </div>
  14. <div class="row">
  15. <div :class="listClass">
  16. <ListView :items="list" @onRowClick="onRowClick" />
  17. </div>
  18. <div class="col-md-6" v-if="showDetailView">
  19. <DetailView :item="detailItem" />
  20. </div>
  21. </div>
  22. <hr />
  23. </div>
  24. </template>
  25. <script>
  26. import { mapState, mapActions } from 'vuex';
  27. import ListView from '../shared/listView.vue';
  28. import DetailView from './templateDetail.vue';
  29. export default {
  30. data() {
  31. return {
  32. detailItem: undefined,
  33. };
  34. },
  35. components: {
  36. ListView,
  37. DetailView,
  38. },
  39. mounted() {
  40. this.getList();
  41. },
  42. computed: {
  43. ...mapState('template', ['list', 'item']),
  44. showDetailView() {
  45. return this.detailItem !== undefined && this.detailItem != null;
  46. },
  47. listClass() {
  48. return this.detailItem !== undefined && this.detailItem != null
  49. ? 'col-md-6'
  50. : 'col-md-12';
  51. },
  52. },
  53. methods: {
  54. ...mapActions('template', ['getList']),
  55. onRowClick(item) {
  56. console.log(item);
  57. this.detailItem = item;
  58. },
  59. },
  60. };
  61. </script>