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
51
52
53
54
| <template>
| <el-time-picker
| v-model="selectValue"
| value-format="HH:mm:ss"
| :placeholder="placeholder"
| :picker-options="pickerOptions"
| @change="onSelected">
| </el-time-picker>
| </template>
| <script>
|
| export default {
| name: 'ZtTimePicker',
| components: {},
| props: {
| value: [String, Date],
| max: { // 可选最大时间
| type: String,
| default: '23:59:59'
| },
| min: { // 可选最小时间
| type: String,
| default: '00:00:00'
| },
| placeholder: {
| type: String,
| default: '选择时间'
| }
| },
| data() {
| return {
| selectValue: '',
| pickerOptions: {
| selectableRange: this.min + ' - ' + this.max
| }
| }
| },
| watch: {
| value(val, oldval) {
| this.selectValue = val
| }
| },
| mounted() {
| },
| methods: {
| onSelected(data) {
| this.$emit('input', this.selectValue)
| }
| }
| }
| </script>
| <style lang="scss">
|
| </style>
|
|