Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rater不支持自定义最小和最大分值,并且更改样式后会被立即覆盖 #2439

Closed
Horzen opened this issue Jan 23, 2018 · 2 comments

Comments

@Horzen
Copy link

Horzen commented Jan 23, 2018

qzpcvxnlcnncag9yemvuxefwcerhdgfcum9hbwluz1xeaw5nvgfsa1w4nzc1otq0nvxjbwfnzuzpbgvzxdjgnzm0nze5ltq3rkutngzims1bqtc4luy4mjlgmdm5oeuwmi5wbmc
当前需求:最低分值是1分,可是组件支持的最低值是0.当用户点击0分后,在js中更改样式为红色,不生效。定位原因是被覆盖掉。
解决办法是:使用两个Rater,一个只有1颗星,并且disabled,另一个只有4颗星,可用。
但是这样不太好。希望能够支持自定义Rater的最低分值或者最高分值。

@RoseEnd
Copy link

RoseEnd commented Jan 24, 2018

我也有同样的需求,看了源码,只需要在watch中修改如下代码即可

currentValue (val) {
        if (val < 1) this.currentValue = 1;
      this.updateStyle()
      this.$emit('input', val)
    },

希望作者大大能够增加一个最小值的prop

wg5945 pushed a commit that referenced this issue Jan 25, 2018
@wg5945
Copy link
Collaborator

wg5945 commented Jan 25, 2018

下个版本支持

@wg5945 wg5945 closed this as completed Jan 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants