1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<template>
<el-time-picker
v-model="timeVal"
class="rc-time"
type="time"
:format="format"
:value-format="format"
:placeholder="placeholder"
@change="handleInput"
/>
</template>
<script>
export default {
name: 'RcTime',
props: {
placeholder: {
type: String,
default: '请选择时间'
},
format: {
type: String,
default: 'HH:mm:ss'
},
value: [String, Array]
},
data() {
return {
timeVal: this.value
}
},
watch: {
value(newVal) {
this.timeVal = newVal
}
},
methods: {
handleInput(val) {
this.$emit('input', val)
}
}
}
</script>
<style lang="stylus" scoped>
.rc-time {
&.el-input {
width 202px
}
}
</style>