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.

carouselList.vue 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <!-- eslint-disable max-len -->
  3. <div>
  4. <div class="container">
  5. <div class="container">
  6. <div class="row">
  7. <div class="col-md-12 col-lg-8">
  8. <div class="title-box-d">
  9. <br />
  10. <h1 class="title-d" style="text-align:left; font-size: 250%">Carousel Items</h1>
  11. </div>
  12. <br />
  13. </div>
  14. </div>
  15. </div>
  16. </div>
  17. <div class="container">
  18. <button type="button" @click="New()" class="btn btn-b-n" style="width: 85px; height:40px;">New</button>
  19. </div>
  20. <div class="container">
  21. <table class="table table-bordered">
  22. <thead>
  23. <tr>
  24. <th>Image</th>
  25. <th>Header</th>
  26. <th>Type</th>
  27. <th></th>
  28. </tr>
  29. </thead>
  30. <tbody>
  31. <tr v-for="(item, i) in carouselList" :key="i">
  32. <td>
  33. <img :src="item.image" style="height:100px; width:100px; object-fit: cover;" />
  34. </td>
  35. <td>{{ item.header }}</td>
  36. <td v-if="item.propertyId">Property</td>
  37. <td v-else>Timeshare Week</td>
  38. <td>
  39. <button
  40. type="button"
  41. @click="Delete(item.id)"
  42. class="btn"
  43. style="margin:2px; color: #60CBEB"
  44. >Delete</button>
  45. </td>
  46. </tr>
  47. </tbody>
  48. </table>
  49. </div>
  50. <br />
  51. </div>
  52. </template>
  53. <script>
  54. import { mapState, mapActions } from 'vuex';
  55. export default {
  56. name: 'CarouselList',
  57. data() {
  58. return {};
  59. },
  60. methods: {
  61. ...mapActions('carousel', ['getCarouselList', 'deleteCarousel']),
  62. New() {
  63. this.$router.push('/carousel/details/0');
  64. },
  65. Edit(itemID) {
  66. this.$router.push({
  67. path: `/carousel/details/${itemID}`,
  68. });
  69. },
  70. Delete(id) {
  71. this.deleteCarousel(id);
  72. },
  73. },
  74. mounted() {
  75. this.getCarouselList();
  76. },
  77. computed: {
  78. ...mapState('carousel', ['carouselList']),
  79. },
  80. };
  81. </script>