fix(touch): 修复移动端 rate, carousel 一些小问题 (#1469)
* 修复 carousel 移动端滑动切换后,点击箭头切换异常的问题 * 修复 rate 移动端滑动时,评分文本未更新的问题
This commit is contained in:
parent
574214e7a4
commit
dc7183f7b4
@ -568,9 +568,12 @@
|
||||
var onStart = function(e){
|
||||
if(e.touches.length !== 1) return;
|
||||
bindEvents();
|
||||
// 重置状态
|
||||
state.timeStart = Date.now();
|
||||
state.pointerStart.x = state.pointerEnd.x = e.touches[0].clientX;
|
||||
state.pointerStart.y = state.pointerEnd.y = e.touches[0].clientY;
|
||||
state.distanceX = state.distanceY = 0;
|
||||
state.direction = 'none'
|
||||
|
||||
options.onTouchStart && options.onTouchStart(e, state);
|
||||
}
|
||||
|
@ -253,6 +253,7 @@ layui.define(['jquery', 'lay'],function(exports){
|
||||
|
||||
// 更新最终值
|
||||
options.value = score;
|
||||
if(options.text) _ul.next("span").text(options.value + "星");
|
||||
options.setText && options.setText(options.value);
|
||||
},
|
||||
onTouchEnd: function(e, state){
|
||||
|
Loading…
Reference in New Issue
Block a user