File tree Expand file tree Collapse file tree 5 files changed +67
-10
lines changed Expand file tree Collapse file tree 5 files changed +67
-10
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ yarn add vue-daily-scheduler
21
21
```
22
22
Browser
23
23
``` html
24
- <script src =" https://unpkg.com/vue-daily-scheduler@latest/dist/vue-schedule.min.js" />
24
+ <link href =" https://unpkg.com/vue-daily-scheduler@latest/dist/vue-schedule.min.css" ref =" stylesheet" />
25
+ <script src =" https://unpkg.com/vue-daily-scheduler@latest/dist/vue-schedule.min.js" ></script >
25
26
```
26
27
27
28
then, use inside a component
@@ -55,6 +56,28 @@ use it inside vue template
55
56
</template >
56
57
```
57
58
59
+ ### Props
60
+ | Props| Desc| Type| Default|
61
+ | ---| ---| ---| ---|
62
+ | ` bg ` | Block scheduler bacground color| ` String ` | ` #223642 ` |
63
+ | ` bgHover ` | Block scheduler bacground color when on hover| ` String ` | ` #84dafc7a ` |
64
+ | ` bgActive ` | Block scheduler bacground color when active| ` String ` | ` #84c9fc ` |
65
+ | ` textColor ` | Text color inside block scheduler| ` String ` | ` #000 ` |
66
+ #### Example
67
+ ``` html
68
+ <template >
69
+ <div >
70
+ <VueSchedule
71
+ v-model =" schedule"
72
+ bg =" red"
73
+ bgHover =" gray"
74
+ bgActive =" black"
75
+ textColor =" #fff"
76
+ />
77
+ </div >
78
+ </template >
79
+ ```
80
+
58
81
### Contributor
59
82
Feel free if you want to submit pull request or an issue.
60
83
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue-daily-scheduler" ,
3
- "version" : " 1.0.1 " ,
3
+ "version" : " 1.0.3 " ,
4
4
"private" : false ,
5
5
"author" : " Burhanuddin Ahmed" ,
6
6
"license" : " MIT" ,
Original file line number Diff line number Diff line change 5
5
<span style =" padding : 10px " >Vue week schedule</span >
6
6
</div >
7
7
<div style =" width : 500px ; margin : 0 auto ; padding : 20px " >
8
- <schedule v-model =" schedule" />
8
+ <schedule v-model =" schedule" bgHover = " black " />
9
9
</div >
10
10
<div style =" margin : 20px ; padding : 20px ; background-color : gray ; color : white " >
11
11
<code >{{ JSON.stringify(schedule) }}</code >
Original file line number Diff line number Diff line change 24
24
cursor : pointer;
25
25
}
26
26
.vws-rule-time-week , .vws-rule-time-item {
27
- background : # 223642 ;
27
+ /* background: #223642; */
28
+ background : var (--vws-bg );
28
29
}
29
30
30
31
.vws-rule-time-week .active , .vws-rule-time-item .active {
31
- background : # 84c9fc ;
32
+ /* background: #84c9fc; */
33
+ background : var (--vws-bgActive );
32
34
}
33
35
.vws-rule-time-week : hover ,
34
36
.vws-rule-time-item : hover ,
35
37
.vws-rule-time-week .active : hover ,
36
38
.vws-rule-time-item .active : hover {
37
- background : # 84dafc7a ;
39
+ /* background: #84dafc7a; */
40
+ background : var (--vws-bgHover );
38
41
}
39
42
40
43
.vws-rule-time-item span {
55
58
.vws-rule-time-item .active span {
56
59
display : block;
57
60
text-align : center;
58
- color : # 000 ;
61
+ /* color: #000; */
62
+ color : var (--vws-text );
59
63
}
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ Copyright Sultan Ads 2020.
7
7
-->
8
8
9
9
<template >
10
- <div style =" position : relative " >
10
+ <div style =" position : relative " :style = " rootCssVar " >
11
11
<div class =" vws-rule-custom" style =' user-select : none ;' >
12
12
<div class =" vws-rule-row" >
13
13
<div class =" vws-table-rule" >
@@ -114,7 +114,27 @@ Copyright Sultan Ads 2020.
114
114
<script >
115
115
import ' ../assets/style.css'
116
116
export default {
117
- props: [' value' ],
117
+ props: {
118
+ value: {
119
+ type: Object
120
+ },
121
+ bg: {
122
+ type: String ,
123
+ default: ' #223642'
124
+ },
125
+ bgHover: {
126
+ type: String ,
127
+ default: ' #84dafc7a'
128
+ },
129
+ bgActive: {
130
+ type: String ,
131
+ default: ' #84c9fc'
132
+ },
133
+ textColor: {
134
+ type: String ,
135
+ default: ' #000'
136
+ }
137
+ },
118
138
data () {
119
139
return {
120
140
timeArray: [],
@@ -391,6 +411,16 @@ export default {
391
411
this .timetable = val;
392
412
}
393
413
}
414
+ },
415
+ computed: {
416
+ rootCssVar () {
417
+ return {
418
+ ' --vws-bg' : this .bg ,
419
+ ' --vws-bgActive' : this .bgActive ,
420
+ ' --vws-bgHover' : this .bgHover ,
421
+ ' --vws-text' : this .textColor
422
+ }
423
+ }
394
424
}
395
425
}
396
- </script >
426
+ </script >
You can’t perform that action at this time.
0 commit comments