From 29cbad142f53cfbe61825070c7456fe1aa76955e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Thu, 9 Oct 2025 23:55:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(slider):=20=E4=BC=98=E5=8C=96=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E6=9D=A1=E7=9A=84=E7=AE=AD=E5=A4=B4=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=20(#2849)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/css/layui.css | 2 +- src/modules/slider.js | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/css/layui.css b/src/css/layui.css index 66d65599..7a428b11 100644 --- a/src/css/layui.css +++ b/src/css/layui.css @@ -1632,7 +1632,7 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co .layui-slider-wrap-btn.layui-slider-hover{transform: scale(1.2);} .layui-slider-wrap-btn.layui-disabled:hover{transform: scale(1) !important;} .layui-slider-tips{position: absolute; top: -42px; z-index: 77777777; white-space:nowrap; -webkit-transform: translateX(-50%); transform: translateX(-50%); color: #FFF; background: #000; border-radius: 3px; height: 25px; line-height: 25px; padding: 0 10px;} -.layui-slider-tips:after{content: ""; position: absolute; bottom: -12px; left: 50%; margin-left: -6px; width: 0; height: 0; border-width: 6px; border-style: solid; border-color: #000 transparent transparent transparent;} +.layui-slider-tips:after{content: ""; position: absolute; bottom: -11px; left: 50%; margin-left: -6px; width: 0; height: 0; border-width: 6px; border-style: solid; border-color: #000 transparent transparent transparent;} .layui-slider-input{width: 70px; height: 32px; border: 1px solid #eee; border-radius: 3px; font-size: 16px; line-height: 32px; position: absolute; right: 0; top: -14px; box-sizing: border-box;} .layui-slider-input-btn{position: absolute; top: 0; right: 0; width: 20px; height: 100%; border-left: 1px solid #eee;} .layui-slider-input-btn i{cursor: pointer; position: absolute; right: 0; bottom: 0; width: 20px; height: 50%; font-size: 12px; line-height: 16px; text-align: center; color: #999;} diff --git a/src/modules/slider.js b/src/modules/slider.js index 97d55b53..5e272b94 100644 --- a/src/modules/slider.js +++ b/src/modules/slider.js @@ -2,7 +2,7 @@ * slider 滑块组件 */ -layui.define(['component', 'jquery', 'lay'], function(exports) { +layui.define('component', function(exports) { 'use strict'; var $ = layui.$; @@ -11,19 +11,19 @@ layui.define(['component', 'jquery', 'lay'], function(exports) { var component = layui.component({ name: 'slider', config: { - type: 'default', //滑块类型,垂直:vertical - min: 0, //最小值 - max: 100, //最大值,默认100 - value: 0, //初始值,默认为0 - step: 1, //间隔值 - showstep: false, //间隔点开启 - tips: true, //文字提示,开启 - tipsAlways: false, //文字提示,始终开启 - input: false, //输入框,关闭 - range: false, //范围选择,与输入框不能同时开启,默认关闭 - height: 200, //配合 type:"vertical" 使用,默认200px - disabled: false, //滑块禁用,默认关闭 - theme: '#16baaa' //主题颜色 + type: 'default', // 滑块类型,垂直:vertical + min: 0, // 最小值 + max: 100, // 最大值,默认100 + value: 0, // 初始值,默认为0 + step: 1, // 间隔值 + showstep: false, // 间隔点开启 + tips: true, // 文字提示,开启 + tipsAlways: false, // 文字提示,始终开启 + input: false, // 输入框,关闭 + range: false, // 范围选择,与输入框不能同时开启,默认关闭 + height: 200, // 配合 type:"vertical" 使用,默认200px + disabled: false, // 滑块禁用,默认关闭 + theme: '#16baaa' // 主题颜色 }, CONST: { ELEM_VIEW: 'layui-slider',