浏览代码

fix: rate组件取消选中状态参数回传异常

songqibin 5 年之前
父节点
当前提交
223080033b
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 3 4
      src/packages/rate/rate.vue

+ 3 - 4
src/packages/rate/rate.vue

@@ -12,8 +12,7 @@
         marginRight: spacing + 'px',
         backgroundImage: n <= current ? checkedIcon : uncheckedIcon
       }"
-    >
-    </span>
+    ></span>
   </div>
 </template>
 <script>
@@ -69,8 +68,8 @@ export default {
         } else {
           this.current = idx;
         }
-        this.$emit('input', idx);
-        this.$emit('click', idx);
+        this.$emit('input', this.current);
+        this.$emit('click', this.current);
       }
     }
   },