Advertisement
Guest User

Replies.vue

a guest
Nov 13th, 2017
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <template>
  2.     <div>
  3.         <div v-for="reply in items">
  4.         <!--<div v-for="(reply, index) in items">-->
  5.             <!--<reply :data="reply" @deleted="remove(index)"></reply>-->
  6.             <reply :data="reply"></reply>
  7.         </div>
  8.     </div>
  9. </template>
  10.  
  11. <script>
  12.  
  13.     import Reply from './Reply.vue';
  14.  
  15.     export default {
  16.         props: ['data'],
  17.  
  18.         components: { Reply },
  19.  
  20.         data() {
  21.             return {
  22.                 items: this.data
  23.             }
  24.         },
  25.  
  26.         methods: {
  27.             remove(index) {
  28.                 this.items.splice(index, 1);
  29.  
  30.                 flash('Reactie is verwijderd')
  31.             }
  32.         }
  33.     }
  34. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement