diff --git a/components/rate/index.jsx b/components/rate/index.tsx
similarity index 85%
rename from components/rate/index.jsx
rename to components/rate/index.tsx
index 5fa78528f..52d3feb17 100644
--- a/components/rate/index.jsx
+++ b/components/rate/index.tsx
@@ -1,4 +1,4 @@
-import { inject } from 'vue';
+import { inject, defineComponent } from 'vue';
import omit from 'omit.js';
import PropTypes from '../_util/vue-types';
import { getOptionProps, getComponent } from '../_util/props-util';
@@ -10,8 +10,8 @@ import Tooltip from '../tooltip';
export const RateProps = {
prefixCls: PropTypes.string,
count: PropTypes.number,
- value: PropTypes.value,
- defaultValue: PropTypes.value,
+ value: PropTypes.number,
+ defaultValue: PropTypes.number,
allowHalf: PropTypes.looseBool,
allowClear: PropTypes.looseBool,
tooltips: PropTypes.arrayOf(PropTypes.string),
@@ -20,7 +20,7 @@ export const RateProps = {
autofocus: PropTypes.looseBool,
};
-const Rate = {
+const Rate = defineComponent({
name: 'ARate',
props: RateProps,
setup() {
@@ -35,15 +35,15 @@ const Rate = {
return {node};
},
focus() {
- this.$refs.refRate.focus();
+ (this.$refs.refRate as any).focus();
},
blur() {
- this.$refs.refRate.blur();
+ (this.$refs.refRate as any).blur();
},
},
render() {
const { prefixCls: customizePrefixCls, ...restProps } = getOptionProps(this);
- const getPrefixCls = this.configProvider.getPrefixCls;
+ const { getPrefixCls } = this.configProvider;
const prefixCls = getPrefixCls('rate', customizePrefixCls);
const character = getComponent(this, 'character') || ;
@@ -57,7 +57,7 @@ const Rate = {
};
return ;
},
-};
+});
/* istanbul ignore next */
Rate.install = function(app) {
diff --git a/components/rate/style/index.js b/components/rate/style/index.ts
similarity index 100%
rename from components/rate/style/index.js
rename to components/rate/style/index.ts