Guest User

Untitled

a guest
Mar 24th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. <template>
  2. <v-container>
  3. <v-layout wrap>
  4. <v-flex xs12>
  5. <v-expansion-panel focusable>
  6. <v-expansion-panel-content
  7. v-for="(item, questionIndex) in quiz.questions"
  8. :key="questionIndex"
  9. focusable
  10. >
  11. <div slot="header">{{item.question}}</div>
  12. <v-card class="grey lighten-3">
  13. <v-container>
  14. <v-layout class="pl-2">
  15.  
  16. <!-- HTML... -->
  17.  
  18. <v-btn
  19. v-if="item.answers.length < 5"
  20. class="mt-4"
  21. color="primary"
  22. @click="addAnswer(questionIndex)"
  23. >Add Answer
  24. </v-btn>
  25.  
  26. <!-- HTML... -->
  27. </v-layout>
  28. </v-container>
  29. </v-card>
  30. </v-expansion-panel-content>
  31. </v-expansion-panel>
  32. </v-flex>
  33. </v-layout>
  34. </v-container>
  35. </template>
  36.  
  37. <script>
  38. import { mapMutations, mapGetters } from 'vuex';
  39.  
  40. import { ADD_ANSWER } from '@/store/quiz/mutations';
  41.  
  42. export default {
  43. name: 'quiz-questions',
  44.  
  45. computed: {
  46. ...mapGetters('quiz', {
  47. quiz: 'newQuiz'
  48. })
  49. },
  50.  
  51. methods: {
  52. ...mapMutations('quiz', {
  53. addAnswer: ADD_ANSWER
  54. })
  55. }
  56. }
  57. </script>
Add Comment
Please, Sign In to add comment