Browse Source

feat: rate评分增加取消功能

jerry 5 years ago
parent
commit
0176a13a16
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/packages/rate/rate.vue

+ 5 - 1
src/packages/rate/rate.vue

@@ -64,7 +64,11 @@ export default {
         this.$emit('input', this.current);
         this.$emit('click', this.current);
       } else {
-        this.current = idx;
+        if (this.current == idx) {
+          this.current = 0;
+        } else {
+          this.current = idx;
+        }
         this.$emit('input', idx);
         this.$emit('click', idx);
       }