1
1
<template >
2
- <v-card class =" ContentCard elevation-4" >
3
- <v-card-actions class =" ContentCard-Actions" >
4
- <subject-tag
5
- v-for =" (item, idx) in subjects"
6
- :key =" idx"
7
- class =" ContentCard-SubjectTag"
8
- :name =" item.name || '教科名'"
9
- :icon =" item.icon || ''"
10
- :icon-color =" item.iconColor || 'white'"
11
- :background-color =" item.backgroundColor || '#A5D8FF'"
2
+ <div class =" ContentCard-Outer" >
3
+ <v-card class =" ContentCard elevation-4" >
4
+ <v-card-actions class =" ContentCard-Actions" >
5
+ <subject-tag
6
+ class =" ContentCard-SubjectTag"
7
+ :name =" lesson.subject.name || '教科名'"
8
+ :icon =" lesson.subject.icon || ''"
9
+ :icon-color =" lesson.subject.iconColor || 'white'"
10
+ :background-color =" lesson.subject.color || '#A5D8FF'"
11
+ />
12
+ <subject-tag
13
+ v-if =" lesson.videos.length >= 1"
14
+ class =" ContentCard-SubjectTag"
15
+ :name =" '動画'"
16
+ :icon =" 'mdi-video'"
17
+ :icon-color =" '#424242'"
18
+ :background-color =" '#E0E0E0'"
19
+ />
20
+ </v-card-actions >
21
+ <v-card-title >
22
+ <h2 class =" ContentCard-Title" >{{ lesson.title }}</h2 >
23
+ </v-card-title >
24
+ <v-card-text >
25
+ <p class =" ContentCard-Description" >{{ lesson.description }}</p >
26
+ </v-card-text >
27
+ </v-card >
28
+ <div v-if =" editable" class =" ContentCard-Button-Outer" >
29
+ <content-card-editor-button
30
+ class =" ContentCard-Button"
31
+ icon-name =" mdi-eye-off"
32
+ @click =" $emit('toggleHidden')"
12
33
/>
13
- <subject-tag
14
- v-if =" hasVideo"
15
- class =" ContentCard-SubjectTag"
16
- :name =" '動画'"
17
- :icon =" 'mdi-video'"
18
- :icon-color =" '#424242'"
19
- :background-color =" '#E0E0E0'"
34
+ <content-card-editor-button
35
+ class =" ContentCard-Button"
36
+ icon-name =" mdi-pencil"
37
+ @click =" $emit('clickEditButton')"
20
38
/>
21
- </ v-card-actions >
22
- < v -card-title >
23
- < h2 class =" ContentCard-Title " >{{ title }}</ h2 >
24
- </ v-card-title >
25
- < v-card-text >
26
- < p class = " ContentCard-Description " >{{ description }}</ p >
27
- </v-card-text >
28
- </v-card >
39
+ <!--
40
+ <content -card-editor-button
41
+ class="ContentCard-Button"
42
+ icon-name="mdi-file-multiple"
43
+ / >
44
+ -- >
45
+ </div >
46
+ </div >
29
47
</template >
30
48
31
49
<script lang="ts">
32
50
import Vue from ' vue'
33
51
import SubjectTag from ' @/components/SubjectTag.vue'
52
+ import ContentCardEditorButton from ' @/components/ContentCardEditorButton.vue'
53
+ import { classData } from ' ~/types/store/classData'
34
54
35
55
export default Vue .extend ({
36
- components: { SubjectTag },
56
+ components: {
57
+ SubjectTag ,
58
+ ContentCardEditorButton
59
+ },
37
60
props: {
38
- subjects: {
39
- type: Array ,
40
- default : () => []
41
- },
42
- title: {
43
- type: String ,
44
- default: ' '
45
- },
46
- description: {
47
- type: String ,
48
- default: ' '
61
+ lesson: {
62
+ type: Object as () => classData .Lesson ,
63
+ required: true ,
64
+ default : () => {}
49
65
},
50
- hasVideo : {
66
+ editable : {
51
67
type: Boolean ,
52
68
default: false
53
69
}
@@ -56,7 +72,20 @@ export default Vue.extend({
56
72
</script >
57
73
58
74
<style scoped lang="scss">
75
+ .ContentCard-Outer {
76
+ display : flex ;
77
+ }
78
+ .ContentCard-Button-Outer {
79
+ display : flex ;
80
+ flex-direction : column ;
81
+ flex : 0 1 auto ;
82
+ margin-left : 12px ;
83
+ .ContentCard-Button {
84
+ margin-bottom : 12px ;
85
+ }
86
+ }
59
87
.ContentCard {
88
+ flex : 1 1 auto ;
60
89
color : $color-gray ;
61
90
border-radius : 14px !important ;
62
91
.ContentCard-Actions {
0 commit comments