SHARE
TWEET

Replies.vue

a guest Nov 13th, 2017 120 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>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top