25
25
<div class =" col-3" >
26
26
<p >
27
27
<strong >Show count (Default value)</strong >
28
- <rate :length =" 5" :value =" 3" :showcount = " true " />
28
+ <rate showcount :length =" 5" :value =" 3" />
29
29
</p >
30
30
</div >
31
31
<div class =" col-3" >
32
32
<p >
33
33
<strong >Rate Descriptions</strong >
34
- <rate :length =" 5" :ratedesc =" ['Very Bad', 'Bad', 'Normal', 'Good', 'Very Good'] " />
34
+ <rate :length =" 5" :ratedesc =" desc " />
35
35
</p >
36
36
</div >
37
37
<div class =" col-3" >
38
38
<p >
39
39
<strong >Rate Descriptions (Default Value)</strong >
40
- <rate :length =" 5" :value =" 3" :ratedesc =" ['Very Bad', 'Bad', 'Normal', 'Good', 'Very Good'] " />
40
+ <rate :length =" 5" :value =" 3" :ratedesc =" desc " />
41
41
</p >
42
42
</div >
43
43
<div class =" col-3" >
44
44
<p >
45
45
<strong >Rate Descriptions (Read-only)</strong >
46
- <rate :length =" 5" :value =" 3" :readonly = " true " : ratedesc =" ['Very Bad', 'Bad', 'Normal', 'Good', 'Very Good'] " />
46
+ <rate readonly :length =" 5" :value =" 3" :ratedesc =" desc " />
47
47
</p >
48
48
</div >
49
49
</div >
52
52
<div class =" col-3" >
53
53
<p >
54
54
<strong >Basic</strong >
55
- <rate :length = " 5 " : disabled= " true " :showcount = " true " />
55
+ <rate showcount disabled :length = " 5 " />
56
56
</p >
57
57
</div >
58
58
<div class =" col-3" >
59
59
<p >
60
60
<strong >Default value</strong >
61
- <rate :length =" 5" :value =" 3" :disabled = " true " />
61
+ <rate disabled :length =" 5" :value =" 3" />
62
62
</p >
63
63
</div >
64
64
<div class =" col-3" >
65
65
<p >
66
66
<strong >Show count</strong >
67
- <rate :length =" 5" :value =" 3" :disabled = " true " :showcount = " true " />
67
+ <rate disabled showcount :length =" 5" :value =" 3" />
68
68
</p >
69
69
</div >
70
70
<div class =" col-3" >
71
71
<p >
72
72
<strong >Rate Descriptions</strong >
73
- <rate :length =" 5" :value =" 3" :disabled =" true" :ratedesc =" ['Very Bad', 'Bad', 'Normal', 'Good', 'Very Good']" />
73
+ <rate disabled :length =" 5" :value =" 3" :ratedesc =" desc" />
74
+ </p >
75
+ </div >
76
+ </div >
77
+
78
+ <h2 >Customization</h2 >
79
+ <div class =" grid" >
80
+ <div class =" flex-primary" >
81
+ <p >
82
+ <symbol id =" icon-heart" class =" icon" viewBox =" 0 0 32 32" >
83
+ <path d =" M23.6 2c-3.363 0-6.258 2.736-7.599 5.594-1.342-2.858-4.237-5.594-7.601-5.594-4.637 0-8.4 3.764-8.4 8.401 0 9.433 9.516 11.906 16.001 21.232 6.13-9.268 15.999-12.1 15.999-21.232 0-4.637-3.763-8.401-8.4-8.401z" ></path >
84
+ </symbol >
85
+ <rate class =" RateCustom" :length =" 5" :value =" 3" :ratedesc =" desc" iconref =" icon-heart" />
86
+ <details >
87
+ <summary >Example</summary >
88
+ <div class =" code" >
89
+ <pre >< ; template> ;
90
+ < ; symbol id="icon-heart" class="icon" viewBox="0 0 32 32"> ;
91
+ < ; path d="M23.6 2c-3.363 0-6.258 2.736-7.599 5.594-1.342-2.858-4.237-5.594-7.601-5.594-4.637 0-8.4 3.764-8.4 8.401 0 9.433 9.516 11.906 16.001 21.232 6.13-9.268 15.999-12.1 15.999-21.232 0-4.637-3.763-8.401-8.4-8.401z"> ;< ; /path> ;
92
+ < ; /symbol> ;
93
+
94
+ < ; rate class="RateCustom" :length="5" :value="3" :ratedesc="desc" iconref="icon-heart"> ;
95
+ < ; /template> ;
96
+
97
+ < ; style> ;
98
+ .RateCustom.Rate .icon {
99
+ width: 25px;
100
+ height: 25px;
101
+ }
102
+ .RateCustom.Rate .Rate__star.filled { color: blue; }
103
+ .RateCustom.Rate .Rate__star.hover { color: red; }
104
+ < ; /style> ; </pre >
105
+ </div >
106
+ </details >
74
107
</p >
75
108
</div >
76
109
</div >
@@ -85,7 +118,8 @@ export default {
85
118
name: ' App' ,
86
119
data () {
87
120
return {
88
- myCurrentRate: 0
121
+ myCurrentRate: 3 ,
122
+ desc: [' Very Bad' , ' Bad' , ' Normal' , ' Good' , ' Very Good' ]
89
123
}
90
124
},
91
125
components: {
@@ -122,19 +156,36 @@ export default {
122
156
flex-wrap : wrap ;
123
157
}
124
158
159
+ .code {
160
+ text-align : left ;
161
+ background-color : #efefef ;
162
+ border-radius : 10px ;
163
+ padding : 20px ;
164
+ overflow : auto ;
165
+ max-width : 100% ;
166
+ }
167
+
168
+ .code pre {margin : 0 }
169
+
170
+ .Rate.RateCustom .icon {
171
+ width : 25px ;
172
+ height : 25px ;
173
+ }
174
+
175
+ .Rate.RateCustom .Rate__star.filled {color : teal ;}
176
+ .Rate.RateCustom .Rate__star.hover {color : red ;}
177
+
178
+ .flex-primary { flex : 1 ; width : 100% ; }
125
179
.grid [class *= col- ]{padding : 0 20px ;}
126
180
.grid .col-3 {width : 100% }
127
181
128
182
@media screen and (min-width : 768px ) {
129
- .grid .col-3 {
130
- width :50%
131
- }
183
+ .grid .col-3 {width : 50% ;}
184
+ .grid .col-2 {width : 50% ;}
132
185
}
133
186
134
187
@media screen and (min-width : 992px ) {
135
- .grid .col-3 {
136
- width : 25% ;
137
- }
188
+ .grid .col-3 {width : 25% ;}
138
189
}
139
190
</style >
140
191
0 commit comments