diff --git a/components/rate/__tests__/__snapshots__/demo.test.js.snap b/components/rate/__tests__/__snapshots__/demo.test.js.snap
index 6ee092615..a3ec3c6a5 100644
--- a/components/rate/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/rate/__tests__/__snapshots__/demo.test.js.snap
@@ -229,8 +229,7 @@ exports[`renders ./components/rate/demo/clear.md correctly 1`] = `
- allowClear: true
-
+ allowClear: true
allowClear: false
-
+ allowClear: false
`;
diff --git a/components/rate/__tests__/index.test.js b/components/rate/__tests__/index.test.js
index 36295752f..3944c14c4 100644
--- a/components/rate/__tests__/index.test.js
+++ b/components/rate/__tests__/index.test.js
@@ -1,6 +1,8 @@
import Rate from '..';
import focusTest from '../../../tests/shared/focusTest';
+import mountTest from '../../../tests/shared/mountTest';
describe('Rate', () => {
focusTest(Rate);
+ mountTest(Rate);
});
diff --git a/components/rate/demo/clear.md b/components/rate/demo/clear.md
index 44a4a24b6..3f91786a6 100644
--- a/components/rate/demo/clear.md
+++ b/components/rate/demo/clear.md
@@ -11,10 +11,11 @@ Support set allow to clear star when click again.
```tpl
-
allowClear: true
-
-
allowClear: false
+
+
allowClear: true
+
+
allowClear: false
```
diff --git a/components/rate/index.jsx b/components/rate/index.jsx
index f92c14239..0188deb51 100644
--- a/components/rate/index.jsx
+++ b/components/rate/index.jsx
@@ -31,17 +31,17 @@ const Rate = {
configProvider: { default: () => ConfigConsumerProps },
},
methods: {
+ characterRender(node, { index }) {
+ const { tooltips } = this.$props;
+ if (!tooltips) return node;
+ return {node};
+ },
focus() {
this.$refs.refRate.focus();
},
blur() {
this.$refs.refRate.blur();
},
- characterRender(node, { index }) {
- const { tooltips } = this.$props;
- if (!tooltips) return node;
- return {node};
- },
},
render() {
const { prefixCls: customizePrefixCls, ...restProps } = getOptionProps(this);