Skip to content

Commit f4a7091

Browse files
committed
編集画面用のinputフィールドのコンポーネントを追加
1 parent 0987f8d commit f4a7091

File tree

2 files changed

+142
-0
lines changed

2 files changed

+142
-0
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<template>
2+
<v-text-field
3+
v-model="value"
4+
:color="transparent ? 'white' : '#424242'"
5+
type="text"
6+
:hint="hint"
7+
:label="label"
8+
:placeholder="placeholder"
9+
:background-color="transparent ? 'transparent' : 'white'"
10+
class="elevation-0"
11+
solo
12+
flat
13+
/>
14+
</template>
15+
16+
<script lang="ts">
17+
import Vue from 'vue'
18+
type DataType = {
19+
value: string
20+
}
21+
export default Vue.extend({
22+
name: 'InputField',
23+
props: {
24+
type: {
25+
type: String,
26+
required: false,
27+
default: 'text'
28+
},
29+
label: {
30+
type: String,
31+
required: true,
32+
default: ''
33+
},
34+
hint: {
35+
type: String,
36+
required: false,
37+
default: ''
38+
},
39+
require: {
40+
type: Boolean,
41+
required: false,
42+
default: false
43+
},
44+
placeholder: {
45+
type: String,
46+
required: false,
47+
default: ''
48+
},
49+
transparent: {
50+
type: Boolean,
51+
required: false,
52+
default: false
53+
}
54+
},
55+
data(): DataType {
56+
return {
57+
value: ''
58+
}
59+
},
60+
watch: {
61+
value(value) {
62+
this.$emit('input', value)
63+
}
64+
}
65+
})
66+
</script>
67+
68+
<style lang="scss">
69+
.v-input__slot {
70+
box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.3);
71+
border-radius: 14px !important;
72+
73+
&.transparent {
74+
border: 2px solid $color-white !important;
75+
76+
input {
77+
color: $color-white !important;
78+
}
79+
}
80+
}
81+
</style>

src/components/VideoThumbnail.vue

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<template>
2+
<div>
3+
<span v-if="title" class="VideoThumbnail-Title">{{ title }}</span>
4+
<div class="VideoThumbnail">
5+
<img :src="thumbnailUrl" :alt="caption" />
6+
<span class="caption">{{ caption }}</span>
7+
</div>
8+
</div>
9+
</template>
10+
11+
<script lang="ts">
12+
import Vue from 'vue'
13+
14+
export default Vue.extend({
15+
props: {
16+
title: {
17+
type: String,
18+
required: false,
19+
default: ''
20+
},
21+
thumbnailUrl: {
22+
type: String,
23+
required: false,
24+
default: ''
25+
},
26+
caption: {
27+
type: String,
28+
required: false,
29+
default: ''
30+
}
31+
}
32+
})
33+
</script>
34+
35+
<style lang="scss" scoped>
36+
.VideoThumbnail-Title {
37+
display: block;
38+
font-size: 16px;
39+
font-weight: bold;
40+
color: $color-white;
41+
margin-bottom: 4px;
42+
}
43+
.VideoThumbnail {
44+
border: 2px solid $color-white;
45+
border-radius: 14px;
46+
padding: 16px;
47+
48+
img {
49+
max-width: 100%;
50+
height: auto;
51+
vertical-align: bottom;
52+
}
53+
54+
.caption {
55+
display: block;
56+
color: $color-white;
57+
font-size: 14px;
58+
padding: 8px 0;
59+
}
60+
}
61+
</style>

0 commit comments

Comments
 (0)