1
1
# Vue Tailwind Picker
2
2
> Datepicker for vue.js of tailwindcss & dayjs
3
3
4
+ [ ![ NPM] ( https://nodei.co/npm/vue-tailwind-picker.png?compact=true )] ( https://www.npmjs.com/package/vue-tailwind-picker )
5
+
4
6
![ Example] ( https://raw.githubusercontent.com/kenhyuwa/vue-tailwind-picker/master/vue-tailwind-picker.gif )
5
7
6
8
##### Default
16
18
## Installation
17
19
### NPM
18
20
``` bash
19
- $ npm install vue-tailwind-picker --save
21
+ $ npm install vue-tailwind-picker
22
+ ```
23
+
24
+ ### Yarn
25
+ ``` bash
26
+ $ yarn add vue-tailwind-picker
20
27
```
21
28
22
29
#### CDN
23
30
24
31
``` html
25
- <script src =" https://unpkg.com/vue-tailwind-picker@1.0.3 /dist/vue-tailwind-picker.min.js" ></script >
32
+ <script src =" https://unpkg.com/vue-tailwind-picker@1.1.0 /dist/vue-tailwind-picker.min.js" ></script >
26
33
```
27
34
28
35
If you are using native ES Modules, there is also an ES Modules compatible build:
29
36
``` html
30
37
<script type =" module" >
31
- import VueTailwindPicker from ' https://cdn.jsdelivr.net/npm/vue-tailwind-picker@1.0.3 /dist/vue-tailwind-picker.esm.js'
38
+ import VueTailwindPicker from ' https://cdn.jsdelivr.net/npm/vue-tailwind-picker@1.1.0 /dist/vue-tailwind-picker.esm.js'
32
39
</script >
33
40
```
34
41
@@ -72,8 +79,7 @@ then add to nuxt.config.js
72
79
start-date="2020-01-01"
73
80
end-date="2021-12-31"
74
81
format-date="YYYY-MM-DD"
75
- :inline="true"
76
- :class-name="classObject"
82
+ :theme="classObject"
77
83
:event-date="events"
78
84
@change="(v) => (picker = v)"
79
85
>
@@ -116,28 +122,54 @@ export default {
116
122
classObject(){
117
123
return this.darkMode ?
118
124
{
119
- backgroundColor: '#1A202C',
120
- base: 'gray-800',
121
- hover: 'gray-700',
122
- color: {
123
- default: 'white',
124
- holiday: 'red-500',
125
- weekend: 'indigo-400',
126
- selected: 'teal-400',
127
- event: 'blue-500',
125
+ background: '#1A202C',
126
+ text: 'text-white',
127
+ border: 'border-gray-700',
128
+ currentColor: 'text-gray-200',
129
+ navigation: {
130
+ background: 'bg-gray-800',
131
+ hover: 'hover:bg-gray-700',
132
+ focus: 'bg-gray-700',
133
+ },
134
+ picker: {
135
+ rounded: 'rounded-md',
136
+ selected: {
137
+ background: 'bg-teal-400',
138
+ border: 'border-teal-400',
139
+ hover: 'hover:border-teal-400',
140
+ },
141
+ holiday: 'text-red-400',
142
+ weekend: 'text-green-400',
143
+ event: 'bg-blue-500',
144
+ },
145
+ event: {
146
+ border: 'border-gray-700',
128
147
},
129
148
} :
130
149
{
131
- backgroundColor: '#FFFFFF',
132
- base: 'gray-100',
133
- hover: 'gray-200',
134
- color: {
135
- default: 'gray-700',
136
- holiday: 'red-400',
137
- weekend: 'green-400',
138
- selected: 'red-500',
139
- event: 'indigo-500',
140
- },
150
+ background: '#FFFFFF',
151
+ text: 'text-gray-700',
152
+ border: 'border-gray-200',
153
+ currentColor: 'text-gray-200',
154
+ navigation: {
155
+ background: 'bg-gray-100',
156
+ hover: 'hover:bg-gray-200',
157
+ focus: 'bg-gray-200',
158
+ },
159
+ picker: {
160
+ rounded: 'rounded-full',
161
+ selected: {
162
+ background: 'bg-red-500',
163
+ border: 'border-red-500',
164
+ hover: 'hover:border-red-500',
165
+ },
166
+ holiday: 'text-red-400',
167
+ weekend: 'text-green-400',
168
+ event: 'bg-indigo-500',
169
+ },
170
+ event: {
171
+ border: 'border-gray-200',
172
+ },
141
173
}
142
174
}
143
175
}
@@ -182,7 +214,7 @@ export default {
182
214
<td>false</td>
183
215
</tr >
184
216
<tr >
185
- <td>className </td>
217
+ <td>theme </td>
186
218
<td>Object</td>
187
219
<td>false</td>
188
220
<td>see example, default object is light mode</td>
@@ -199,6 +231,12 @@ export default {
199
231
<td>false</td>
200
232
<td>$emit()</td>
201
233
</tr >
234
+ <tr >
235
+ <td>autoClose</td>
236
+ <td>Boolean</td>
237
+ <td>false</td>
238
+ <td>true</td>
239
+ </tr >
202
240
</tbody >
203
241
</table >
204
242
@@ -207,4 +245,10 @@ please contribute to be better...
207
245
208
246
## License
209
247
210
- [ MIT] ( http://opensource.org/licenses/MIT )
248
+ The MIT License (MIT). Please see [ LICENSE] ( http://opensource.org/licenses/MIT ) for more information.
249
+
250
+ ## Changelog
251
+
252
+ Please see [ CHANGELOG] ( CHANGELOG.md ) for more information what has changed recently
253
+
254
+ _ Made with love by [ Ken] ( https://facebook.com/diaddemi ) _
0 commit comments