Skip to content

Commit

Permalink
feat(rate): del invalid code
Browse files Browse the repository at this point in the history
  • Loading branch information
liaohainan committed Nov 15, 2022
1 parent 848c6af commit 8341d33
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/quark/src/rate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,9 @@ class QuarkRate extends QuarkElement {

handleChange(i: { id: number; color: string }) {
if (!this.shadowRoot) return;
const { id, color } = i;
const { id } = i;
this.stars = this.stars.map((item) => {
item.color = "inherit";
if (color === this.activecolor) {
item.color = "inherit";
}
if (item.id <= id) item.color = this.activecolor;
item.color = item.id <= id ? this.activecolor : "inherit";
return item;
});
const value = this.stars.filter((i) => i.color === this.activecolor).length;
Expand Down

0 comments on commit 8341d33

Please sign in to comment.