diff --git a/src/form/demo/FieldType.vue b/src/form/demo/FieldType.vue
index 0b3d89d92..4daac1680 100644
--- a/src/form/demo/FieldType.vue
+++ b/src/form/demo/FieldType.vue
@@ -9,6 +9,10 @@
+
+
+
+
{{ $t('submit') }}
@@ -20,6 +24,7 @@
export default {
i18n: {
'zh-CN': {
+ rate: '评分',
submit: '提交',
switch: '开关',
checkbox: '复选框',
@@ -27,6 +32,7 @@ export default {
requireCheckbox: '请勾选复选框',
},
'en-US': {
+ rate: 'Rate',
submit: 'Submit',
switch: 'Switch',
checkbox: 'Checkbox',
@@ -37,6 +43,7 @@ export default {
data() {
return {
+ rate: 3,
checkbox: false,
switchChecked: false,
};
diff --git a/src/rate/index.js b/src/rate/index.js
index b107f26aa..a0ae252ba 100644
--- a/src/rate/index.js
+++ b/src/rate/index.js
@@ -1,6 +1,12 @@
+// Utils
import { createNamespace, addUnit } from '../utils';
import { preventDefault } from '../utils/dom/event';
+
+// Mixins
import { TouchMixin } from '../mixins/touch';
+import { FieldMixin } from '../mixins/field';
+
+// Components
import Icon from '../icon';
const [createComponent, bem] = createNamespace('rate');
@@ -18,7 +24,7 @@ function getRateStatus(value, index, allowHalf) {
}
export default createComponent({
- mixins: [TouchMixin],
+ mixins: [TouchMixin, FieldMixin],
props: {
size: [Number, String],