File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ export default {
133133 let rand_number = e .name
134134 .split (' ' )
135135 .map ((c ) => c .codePointAt (0 ))
136- .reduce ((a , b ) => a + b)
136+ .reduce ((a , b ) => a + b, 0 )
137137 let l = this .colors .length
138138 return this .colors [rand_number % l]
139139 },
Original file line number Diff line number Diff line change 11<template >
22 <v-row justify =" center" align =" center" >
3- <v-col cols =" 12" sm =" 12" md =" 10" lg =" 8" >
4- <v-card class =" py-4 d-flex flex-column align-center" >
5- <div >Total Hours : 10</div >
6- <div >1 2 3 4 5</div >
3+ <v-col cols =" 12" sm =" 12" md =" 12" lg =" 8" >
4+ <v-card >
5+ <v-card-title > Total Credits: {{ totalCredits }}</v-card-title >
6+ <div class =" text-center" >
7+ <v-chip
8+ class =" ma-2"
9+ v-for =" clas in selectedClasses"
10+ :key =" clas.crn"
11+ close
12+ >
13+ {{ clas.name }}{{ clas.credits }} {{ clas.crn }}
14+ </v-chip >
15+ </div >
716 </v-card >
817 </v-col >
918 </v-row >
1019</template >
1120
12- <script lang="ts"></script >
21+ <script >
22+ export default {
23+ data () {
24+ return {}
25+ },
26+ props: {
27+ selectedClasses: { type: Array , default: [] },
28+ },
29+ computed: {
30+ totalCredits () {
31+ console .log (this .selectedClasses )
32+ return this .selectedClasses .reduce ((a , b ) => a + b .credits , 0 )
33+ },
34+ },
35+ }
36+ </script >
You can’t perform that action at this time.
0 commit comments