File tree Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <div ref =" date-picker" class =" date-picker" @click.stop >
3
- <TextField :is-focused =" focused" :is-loading =" isLoading" :disabled =" isLoading"
2
+ <div ref =" date-picker" class =" date-picker" :class = " { 'date-picker-disabled': disabled } " @click.stop >
3
+ <TextField :is-focused =" focused" :is-loading =" isLoading" :disabled =" disabled || isLoading"
4
4
:is-invalid =" isInvalid" select @mousedown =" toggle" >
5
5
<input ref =" input" :value =" formattedDate" type =" text"
6
- width =" 50%" placeholder =" e.g. 31/12/2018" :disabled =" isLoading"
6
+ width =" 50%" placeholder =" e.g. 31/12/2018" :disabled =" disabled || isLoading"
7
7
v-on =" listeners" @keydown.enter =" onEnter"
8
8
@input =" onInput" @keyup.esc =" onEsc"
9
9
@focus =" onFocus" @blur =" onBlur" >
51
51
type: String ,
52
52
default: ' dd/MM/y'
53
53
},
54
+ disabled: {
55
+ type: Boolean ,
56
+ default: false ,
57
+ },
54
58
disabledRange: {
55
59
type: Object ,
56
60
default : () => ({
151
155
.icon {
152
156
padding-right : 8px ;
153
157
}
158
+
159
+ .date-picker-disabled {
160
+ cursor : not-allowed ;
161
+ }
154
162
</style >
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" wrapper" >
3
- <DatePicker v-model =" date" />
3
+ <DatePicker v-model =" date" />
4
+ <DatePicker v-model =" date" :disabled =" true" />
4
5
</div >
5
6
</template >
6
7
17
18
}
18
19
};
19
20
</script >
21
+
22
+ <style scoped>
23
+ .wrapper {
24
+ display : flex ;
25
+ flex-direction : column ;
26
+ row-gap : 10px ;
27
+ }
28
+ </style >
You can’t perform that action at this time.
0 commit comments