Guest User

Untitled

a guest
Sep 22nd, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <tr v-for="(category,index) in allCategories">
  2. <td class="v-align-middle"> <img :src="category.images[0].link" class="img-fluid categoriesImg" alt=""> </td>
  3. <td class="v-align-middle">{{category.category}}</td>
  4. <td class="v-align-middle">{{formatDate(category.created_at)}}</td>
  5. </tr>
  6.  
  7.  
  8.  
  9. <script>
  10.  
  11.  
  12.  
  13. import {mapGetters} from 'vuex';
  14. export default {
  15. name:"category",
  16. computed: {
  17. ...mapGetters({
  18. allCategories:'allCategories'
  19. }),
  20.  
  21. },
  22. created(){
  23.  
  24. // this.$swal('Hello Vue world!!!');
  25.  
  26. this.$store.dispatch('GetAllCategories');
  27.  
  28. },
  29. methods:{
  30. formatDate(date){
  31. let tanggal = new Date(date);
  32. return tanggal;
  33. },
  34. }
  35.  
  36. }
  37. </script>
  38.  
  39. "2018-09-21T22:20:48.000Z"
Add Comment
Please, Sign In to add comment