Repository navigation
[slider] 如何获得值?
#3129
Replies: 1 comment
|
实例 A 上没有当前值。 拿内部实例读 var inst = layui.slider.getInst(A.id); // 未传 id 时,A.id 默认取元素 id
var value = 'value' in inst ? inst.value : inst.config.value;
不想依赖内部实例的话,直接读 DOM 也行,滑块把当前值存在 layui.$(A.config.elem).find('.layui-slider-wrap').data('value');在 2.13.0 上实测: |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
议题条件
议题类型
疑是 BUG
使用版本
v2.13
问题描述
在别的页面有:
let A = slider.render({
elem: '#id',
value:22,
});
reutrn A
但以上内容我是没有权限知道的,我只能拿到A实例。
因此我有slider实例A,但在没有触发change,也没有触发done的情况下,如何获得A的值?
业务代码
截图补充
No response
浏览器
chrome
演示地址
No response
友好承诺
All reactions