mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
fix(Rate): support touch move and selected half star (#4195)
This commit is contained in:
parent
1579f7cddd
commit
1292b7cfd5
@ -34,7 +34,6 @@
|
|||||||
color="#ee0a24"
|
color="#ee0a24"
|
||||||
void-color="#eee"
|
void-color="#eee"
|
||||||
void-icon="star"
|
void-icon="star"
|
||||||
touchable="{{ false }}"
|
|
||||||
/>
|
/>
|
||||||
</demo-block>
|
</demo-block>
|
||||||
|
|
||||||
|
@ -85,8 +85,9 @@ VantComponent({
|
|||||||
|
|
||||||
getAllRect(this, '.van-rate__icon').then((list) => {
|
getAllRect(this, '.van-rate__icon').then((list) => {
|
||||||
const target = list
|
const target = list
|
||||||
.sort((item) => item.right - item.left)
|
.sort((cur, next) => cur.dataset.score - next.dataset.score)
|
||||||
.find((item) => clientX >= item.left && clientX <= item.right);
|
.find((item) => clientX >= item.left && clientX <= item.right);
|
||||||
|
|
||||||
if (target != null) {
|
if (target != null) {
|
||||||
this.onSelect({
|
this.onSelect({
|
||||||
...event,
|
...event,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user