Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <tr v-for="(category,index) in allCategories">
- <td class="v-align-middle"> <img :src="category.images[0].link" class="img-fluid categoriesImg" alt=""> </td>
- <td class="v-align-middle">{{category.category}}</td>
- <td class="v-align-middle">{{formatDate(category.created_at)}}</td>
- </tr>
- <script>
- import {mapGetters} from 'vuex';
- export default {
- name:"category",
- computed: {
- ...mapGetters({
- allCategories:'allCategories'
- }),
- },
- created(){
- // this.$swal('Hello Vue world!!!');
- this.$store.dispatch('GetAllCategories');
- },
- methods:{
- formatDate(date){
- let tanggal = new Date(date);
- return tanggal;
- },
- }
- }
- </script>
- "2018-09-21T22:20:48.000Z"
Add Comment
Please, Sign In to add comment