File tree Expand file tree Collapse file tree 4 files changed +13
-12
lines changed Expand file tree Collapse file tree 4 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -229,8 +229,7 @@ exports[`renders ./components/rate/demo/clear.md correctly 1`] = `
229
229
</svg ></i ></div >
230
230
</div >
231
231
</li >
232
- </ul > allowClear: true
233
- <br >
232
+ </ul > <span class = " ant-rate-text" >allowClear: true</span > <br >
234
233
<ul tabindex = " 0" role = " radiogroup" class = " ant-rate" >
235
234
<li class = " ant-rate-star ant-rate-star-full" >
236
235
<div role = " radio" aria-checked = " true" aria-posinset = " 1" aria-setsize = " 5" tabindex = " 0" >
@@ -282,8 +281,7 @@ exports[`renders ./components/rate/demo/clear.md correctly 1`] = `
282
281
</svg ></i ></div >
283
282
</div >
284
283
</li >
285
- </ul > allowClear: false
286
- <br >
284
+ </ul > <span class = " ant-rate-text" >allowClear: false</span >
287
285
</div >
288
286
`;
289
287
Original file line number Diff line number Diff line change 1
1
import Rate from '..' ;
2
2
import focusTest from '../../../tests/shared/focusTest' ;
3
+ import mountTest from '../../../tests/shared/mountTest' ;
3
4
4
5
describe ( 'Rate' , ( ) => {
5
6
focusTest ( Rate ) ;
7
+ mountTest ( Rate ) ;
6
8
} ) ;
Original file line number Diff line number Diff line change @@ -11,10 +11,11 @@ Support set allow to clear star when click again.
11
11
``` tpl
12
12
<template>
13
13
<div>
14
- <a-rate :defaultValue="3" /> allowClear: true
15
- <br />
16
- <a-rate :allowClear="false" :defaultValue="3" /> allowClear: false
14
+ <a-rate :defaultValue="3" />
15
+ <span class="ant-rate-text">allowClear: true</span>
17
16
<br />
17
+ <a-rate :allowClear="false" :defaultValue="3" />
18
+ <span class="ant-rate-text">allowClear: false</span>
18
19
</div>
19
20
</template>
20
21
```
Original file line number Diff line number Diff line change @@ -31,17 +31,17 @@ const Rate = {
31
31
configProvider : { default : ( ) => ConfigConsumerProps } ,
32
32
} ,
33
33
methods : {
34
+ characterRender ( node , { index } ) {
35
+ const { tooltips } = this . $props ;
36
+ if ( ! tooltips ) return node ;
37
+ return < Tooltip title = { tooltips [ index ] } > { node } </ Tooltip > ;
38
+ } ,
34
39
focus ( ) {
35
40
this . $refs . refRate . focus ( ) ;
36
41
} ,
37
42
blur ( ) {
38
43
this . $refs . refRate . blur ( ) ;
39
44
} ,
40
- characterRender ( node , { index } ) {
41
- const { tooltips } = this . $props ;
42
- if ( ! tooltips ) return node ;
43
- return < Tooltip title = { tooltips [ index ] } > { node } </ Tooltip > ;
44
- } ,
45
45
} ,
46
46
render ( ) {
47
47
const { prefixCls : customizePrefixCls , ...restProps } = getOptionProps ( this ) ;
You can’t perform that action at this time.
0 commit comments