Advertisement
Guest User

Comments

a guest
Mar 9th, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. <!--suppress ALL -->
  2. <template>
  3. <div class="ui comments">
  4. <div class="ui inverted active dimmer" v-if="loading">
  5. <div class="ui text loader">Récupération des commentaires...</div>
  6. </div>
  7. <comment :comment="comment" :user_id="user_id" v-for="comment in comments"></comment>
  8. <comment-form :id="id" :model="model"></comment-form>
  9. </div>
  10. </template>
  11.  
  12. <script type="text/babel">
  13. import Comment from './comments/Comment.vue'
  14. import CommentForm from './comments/Form.vue'
  15. import { comments } from '../store/getters'
  16. import { getComments } from '../store/actions'
  17.  
  18. export default {
  19. data () {
  20. return {
  21. loading: true
  22. }
  23. },
  24. vuex: {
  25. getters: { comments },
  26. actions: { getComments }
  27. },
  28. components: { Comment, CommentForm },
  29. props: {
  30. id: Number,
  31. model: String,
  32. csrf: String,
  33. user_id: Number
  34. },
  35. mounted () {
  36. this.getComments(this.model, this.id).then(() => {
  37. this.loading = false
  38. })
  39. }
  40. }
  41.  
  42. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement