Tencent / Tencent/tdesign-miniprogram

[rate] rate组件可否增加分数自定义选项?目前只能按照5星5分来算,存在5星10分的场景。

Open
#4,616 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

💪🏻 enhancement
Dominant language
Vue
Stars
1.8k
Forks
337
Avg merge
1d 21h
Merged PRs (30d)
19

Description

选择框架

@tdesign/uniapp

这个功能解决了什么问题

目前只能按照5星5分来算,在很多应用中会存在5星10分的场景,其中半星代表1分,目前我是自己修改rate组件来实现10分评分的场景,希望官方可以加入按10分计算的选项。

你建议的方案是什么

增加参数 maxScore,默认数值为5,当存在自定义值时,按照当前自定义值/星星数量得出半星或者1星的分值,实现评分数值自定义。
示例:

Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the rate component in the @tdesign/uniapp package and inspect how it currently calculates values from five stars. Check the component's existing tests or examples, then confirm the change preserves the default five-point behavior and supports the proposed ten-point scoring case.

Written by the indexing model from the issue text.

Assessment

Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.