index.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <v-responsive max-width="1024" class="mx-auto">
  3. <!-- Title -->
  4. <h1 class="mb-2 display-2 font-weight-light">
  5. {{ $t('learning.exercise.title') }}
  6. </h1>
  7. <!-- release date and due date -->
  8. <div class="mb-2 body-1" flat>
  9. {{ dateInfo }}
  10. </div>
  11. <!-- commit records -->
  12. <exercise-records class="mb-2" :records="exerciseRecords" :commit-limit="commitLimit" />
  13. <!-- button for entering exercising page -->
  14. <v-row>
  15. <v-col>
  16. <v-btn
  17. class="mb-2"
  18. color="primary"
  19. tile
  20. outlined
  21. block
  22. :to="{ path: 'do', query: { exerciseId: exerciseId } }"
  23. nuxt
  24. append
  25. >
  26. {{ $t('learning.exercise.begin') }}
  27. </v-btn>
  28. </v-col>
  29. </v-row>
  30. </v-responsive>
  31. </template>
  32. <script lang="ts">
  33. import Vue from 'vue'
  34. import ExerciseRecords from '~/components/learning/ExerciseRecords.vue'
  35. import { CommitRecord } from '~/components/learning/types'
  36. export default Vue.extend({
  37. components: {
  38. ExerciseRecords
  39. },
  40. data() {
  41. return {
  42. dateInfo: new Date().toString(),
  43. exerciseRecords: [] as CommitRecord[],
  44. commitLimit: 0,
  45. exerciseId: 0
  46. }
  47. },
  48. computed: {
  49. commitTimes(): number {
  50. return this.exerciseRecords.length
  51. }
  52. },
  53. methods: {
  54. getInfo() {
  55. // relese date, due date
  56. },
  57. getExerciseRecords() {
  58. // history
  59. },
  60. doExercise() {
  61. // begin doing exercise
  62. }
  63. }
  64. })
  65. </script>
  66. <style scoped></style>